2 ms·
I’ve used this in the past and its great. Most PRs change something that requires new tests to be written, so I have a rule that any PRs must add unit tests ver
by josephg 6y ago
I’ve used this in the past and its great. Most PRs change something that requires new tests to be written, so I have a rule that any PRs must add unit tests verifying the new behaviour. If your feature really matters to you then it also matters that it’s correct. I don’t want to spend my time triaging bugs in a feature I didn’t write and don’t use.
For some reason this rule weeds out about 80% of contributions - including almost all low quality PRs. It’s delightful.
- jabbany 6y agoI have an anecdote contributing to a testing framework (of all things) that had similar policies. Turns out it's pretty hard to write tests making sure something asynchronously executed never happens sans introducing (flaky) "timeout"-based tests. At some point the maintainers were like, "yeah, this draft PR looks like it's doing the right thing so let's just merge it without a working behavior test"
- josephg 6y agoYeah I make exceptions too when the PR is something I personally care about. (Or I sometimes help out writing tests when someone finds a high priority bug they struggle to reproduce). But I think its a good baseline expectation. Keeping code bug-free is difficult work.