←back to thread

361 points mmphosis | 2 comments | | HN request time: 0.002s | source
Show context
simonw ◴[] No.42165825[source]
"Know when you're testing the framework's capability. If you are, don't do it."

Hard disagree on that. Frameworks change over time. How certain are you that they won't make a seemingly tiny design decision in the future that breaks your software?

One of the most valuable things tests can do for you is to confirm that it is safe to upgrade your dependencies.

If all your test does is duplicate tests from dependency that might be a waste of time... provided that's a stable, documented feature and not something that just happens to work but isn't necessarily expected stable behavior.

But you shouldn't skip testing something because you're confident that the dependency has already covered that.

The tests should prove your software still works.

replies(3): >>42167251 #>>42167793 #>>42168677 #
1. Aeolun ◴[] No.42168677[source]
If you are going to write a test that tests the frameworks capability, submit a PR to the framework.

The only part that's relevant to you is how it interfaces with your own code. If their behavior changes but your code still does exactly what you want it to, the test shouldn't fail.

replies(1): >>42170264 #
2. simonw ◴[] No.42170264[source]
I don't think submitting a PR to a framework is a good strategy:

1. They may not accept the PR

2. Even if they do accept that PR, there's no guarantee that in two years time some maintainer will decide to change that behaviour (and update or discard the test you contributed) anyway.