ScintillatingStruthio

joined 1 day ago

Writing the tests first also ensures that the test actually fails when you expect it to. I've seen test suites that were silently failing for years because they were (presumably) written after the fact and people just assumed that they tested what they said they did. Went in for some other clean up, stared at the test for 10 minutes wondering "how did this ever pass", and then came to realize that test assertions in Jest inside a forEach apparently don't run in the context of the test and failures won't make the test fail. Changing the forEach to a for...of made it all fail immediately.

[–] ScintillatingStruthio@programming.dev 6 points 2 hours ago (3 children)

Neither Javascript nor Typescript require semicolon, it is entirely a stylistic choice except in very rare circumstances that do not come up in normal code.

Given how fast crud accumulates and how much it impacts use, I don't think that would be usable, and probably wouldn't have been for some years.