Giter Club home page Giter Club logo

Comments (4)

get9 avatar get9 commented on June 1, 2024

I tried to find some of the relevant documentation on this and... I’m not really convinced this is really worth the time. Sure, Equals does some magic runtime comparisons, but I think that’s better than having to write yet more “if foo != bar” lines after every operation.

from dhcp.

insomniacslk avatar insomniacslk commented on June 1, 2024

This is just a question, not a proposal - I am not saying we have to move away from stretchr/testify, just that it's worth doing some research to understand pros and cons. When I'll have researched and studied more on the matter, I'll be able to decide if I'll suggest to move away from it or not

from dhcp.

davebarrau avatar davebarrau commented on June 1, 2024

Hey @insomniacslk, did you come to any conclusion on this? Thinking about writing some test cases and don't want to use the wrong library (or have them need to be rewritten later on).

I think for unit testing, it doesn't matter if you fail early, as the end game is you get all tests to pass prior to committing, and you should be running tests often enough that a whole bunch should not blow up at the same time.

I also think the level of automatic detail when using the assert/require libs is great, and it keeps the tests concise.

The point that was made about it not being idiomatic Go.. does it really matter for test code? Happy to go with either option though.

from dhcp.

insomniacslk avatar insomniacslk commented on June 1, 2024

Hey @davebarrau,
For now I don't have yet evidence of the benefits of moving away from the testify library, so we will probably stick with it for the foreseeable future. And as you suggest, for our use case this seems to be just fine.
I am ok to continue using the current assertion library, and keep this open for reconsideration in the future. If we eventually realize that all this was a mistake I'm ok with adjusting all the tests

from dhcp.

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.