Comments (5)
okay @steinfletcher that sounds wonderful i will go ahead with writing the PR then
from apitest.
Hi @anthonyfong100. This sounds very useful. Would be happy to take a PR for this. Changes would need to be backwards compatible. For info, apitest uses testify under the hood. You can already override the Verifier
to implement a custom assertions instead of using testify - see the Verifier
interface in assert.go
. I am planning to remove testify in a future commit, but it's really an implementation detail that the consumer shouldn't care about.
Cheers
from apitest.
Hey @steinfletcher i was thinking more along the lines of passing in an interface to replace the *testing.T
and continue using testify to do the assertions. As of now, testify already supports accepting an interface testingT
as its argument in place of the concrete class *testing.T
. This solution is likely to be better as it allows us to leverage on numerous other assertion methods defined in testify. Do let me know your thoughts on this
from apitest.
Hello @anthonyfong100. Sorry I wasn't clear. I also agree that there should be an interface TestingT
. I was just adding some info on the existing design around assertions, which is completely compatible with the approach you suggest. You'll need to update the Verifier
interface to use TestingT
. Other than that I think it's a simple change.
I'll be removing testify in a future commit for a like-for-like solution, but that doesn't really affect your changes :)
from apitest.
Looks great @anthonyfong100. Many thanks!
from apitest.
Related Issues (20)
- How to set RemoteAddr? HOT 4
- Discussion/Question: Roadmap for end-to-end tests ref https://apitest.dev/docs/config#networking HOT 2
- Typo in start of apitest.dev/docs/reports#reports HOT 1
- option to output sequence diagram with custom name instead of hash HOT 3
- Provide an ability to define a remote address for a test HOT 2
- multipart/form-data sending file HOT 1
- The name set in apitest.New("some name") doesn't seem to show up in logging upon failure HOT 6
- [Question] Support for Fiber v2 HOT 5
- Adding custom context to Request HOT 3
- Failed test in VScode keep trying to open assert.go file HOT 3
- Update echo example to make it more clear HOT 3
- Echo - Assert body contains ID (string) HOT 1
- Align mocks and assertion behaviour for `Header` method and support `HeaderRegexp`
- Example for Fiber HOT 6
- Site example HOT 1
- Site example HOT 5
- Dependabot can't resolve your Go dependency files
- Flow Testing in Table driven HOT 2
- Improvements to response headers assertion error messages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apitest.