Add an init() method which runs once before a testcase
- Dominant language
- JavaScript
- Stars
- 1.9k
- Forks
- 359
- PR merge metrics
- No merged PRs in 30d
Description
It's great having setUp() but quite often (e.g. when loading fixtures into a database) you don't want to do this before every test; you just want to do it once before any of the tests run. Adding fixtures before every test is much slower.
There are workarounds and ways to get setUp to run once but it would be great if there was a method (e.g. init()) which worked in this way.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how nodeunit discovers and invokes setUp in its test runner. Define the lifecycle behavior for an init() hook, including when it runs relative to the first test and how it behaves across test groups. Done means fixtures or other setup work can run once before a testcase's tests rather than before every test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100