Giter Site home page Giter Site logo

Comments (5)

anthonyfong100 avatar anthonyfong100 commented on May 22, 2024 1

okay @steinfletcher that sounds wonderful i will go ahead with writing the PR then

from apitest.

steinfletcher avatar steinfletcher commented on May 22, 2024

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.

anthonyfong100 avatar anthonyfong100 commented on May 22, 2024

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.

steinfletcher avatar steinfletcher commented on May 22, 2024

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.

steinfletcher avatar steinfletcher commented on May 22, 2024

Looks great @anthonyfong100. Many thanks!

from apitest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.