goldbergyoni / goldbergyoni/nodejs-testing-best-practices

Stub inside beforeAll

Open
#67 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.