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)

    Via Twitter. From the book The Gray Lady Winked, photographed by Michael Shermer: Here's the tweet that the paragraph references (took a while…

  • (no subject)

    To unscramble an egg, by the way, would be a closer idiomatic parallel to ungrinding ground meat, and in spite of Julia Ioffe, is just as dark, blunt…

  • (no subject)

    Thought of this phrase today for some reason, then thought whether it exists in English (putting toothpaste back into the tube came to mind), then…

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