You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
'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, your usage of Mocha, or Mocha itself
Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend avoiding the use of globally installed Mocha.
I'm currently loading part of the test classes using require inside of a describe block that groups a couple of tests together:
describe('Authorized calls on the part of a staff member', () => {
require('./tests/asp-net-user');
require('./tests/crawler-status');
...
});
However, I'm now trying to use https://github.com/shannonmoeller/require-glob so that all files the conform to a given glob pattern (e.g., are located in a specifc folder) are included automatically inside that describe block:
describe('Authorized calls on the part of a staff member', () => {
requireGlob('./tests/staff/*.ts');
});
However, the problem with require-glob is that it works asynchronously. Resulting in that the tests get run outside of the 'Authorized calls on the part of a staff member' block.
Steps to Reproduce
Expected behavior:
It would be nice if describe supported the done() parameter, just like it, beforeEach, afterEach do:
describe('Authorized calls on the part of a staff member', (done) => {
requireGlob('./tests/staff/*.ts').then(_ => { done(); });
});
Actual behavior: done parameter of describe callback is not supported
Reproduces how often: Always
Versions
Additional Information
This is a duplicate of #1431, but that one had been illustrated using a different use case and has been legitimately closed.
The text was updated successfully, but these errors were encountered:
Prerequisites
common mistake
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.Description
In my use case, I'm declaring my test routines declaratively using https://github.com/pana-cc/mocha-typescript, so the tests get registered the moment the
@suite
classes are loaded.I'm currently loading part of the test classes using
require
inside of adescribe
block that groups a couple of tests together:However, I'm now trying to use https://github.com/shannonmoeller/require-glob so that all files the conform to a given glob pattern (e.g., are located in a specifc folder) are included automatically inside that
describe
block:However, the problem with require-glob is that it works asynchronously. Resulting in that the tests get run outside of the 'Authorized calls on the part of a staff member' block.
Steps to Reproduce
Expected behavior:
It would be nice if
describe
supported thedone()
parameter, just likeit
,beforeEach
,afterEach
do:Actual behavior:
done
parameter ofdescribe
callback is not supportedReproduces how often: Always
Versions
Additional Information
This is a duplicate of #1431, but that one had been illustrated using a different use case and has been legitimately closed.
The text was updated successfully, but these errors were encountered: