goldbergyoni / goldbergyoni/nodejs-testing-best-practices
Stub inside beforeAll
Open
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 288
- PR merge metrics
- No merged PRs in 30d
Description
[Here](https://github.com/testjavascript/nodejs-integration-tests-best-practices/blob/81fd70a04f3027213190c30459fae84d72fe932e/various-receipes/authentication/test/auth-example-with-stub.test.js#L12) we use sinon.stub in beforeAll. This way we provide only one stub for the whole suite, which cannot be restored later.
Should we always stub inside beforeEach or the arrange phase but not in beforeAll?
Contributor guide
Assessment
This issue has not been assessed yet.