Andrey (azangru) wrote,

An interesting observation: usually, testing gurus suggest (at least for unit tests) to have only one assertion per test — to make it easier to identify why exactly a test failed; but here, Kent C. Dodds is arguing for the opposite case, because he is using Jest as a test runner, and Jest would point out the exact line where the error inside the test occurred. So if one was splitting their tests artificially, just to follow the one expect per test rule, there is no longer a reason for doing so:

It's about as mindblowing as Evan Czaplicki's statement in one of his Elm talks, where he said that he prefers having longer files instead of splitting them into smaller and more focused files, because Elm's type system helps him focus on the relevant parts on the file anyway, without having to keep in mind everything that's going on in the file.

  • (no subject)

    Sanjay Gupta on Joe Rogan: yes, I agree, they shouldn't have said horse dewormer; no, I don't know why they did; no, they shouldn't have done that;…

  • (no subject)

    To the future me: I keep returning in my mind to the simple idea in this talk about containing React component's logic in a custom hook and having a…

  • (no subject)

    I've been listening to The Boys produced by the Graphic Audio. Better than the film; more irreverent; the Butcher character is even more profane and…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.