-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Milestone
Description
Bug Report Checklist
- I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faqlabel, but none matched my issue. - I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
- I want to provide a PR to resolve this
Expected
In doing a final examination of the new ESM export code, I discovered there is one small fix needing to be made.
The method setup should be the TDD setup, not mocha.setup.
Actual
setup is mocha.setup, so setup cannot be used for tdd mode.
Minimal, Reproducible Example
For:
suite('My suite (context)', function () {
suiteTeardown(() => {
console.log('after');
});
teardown(() => {
console.log('after each');
});
suiteSetup(() => {
console.log('before');
});
setup(() => {
console.log('before each');
});
test('my test (specify)', function () {
expect(true).to.equal(true);
});
});..."before each" does not run.
Versions
node_modules/.bin/mocha --version: 11.7.4
node --version: v22.16.0
Additional Info
No response
Metadata
Metadata
Assignees
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: buga defect, confirmed by a maintainera defect, confirmed by a maintainer
Type
Projects
Status
Done