test: add disabled tests list (#37334)
This commit is contained in:
parent
87f2a1d572
commit
1f390119fe
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const v8 = require('v8');
|
||||
|
||||
|
@ -65,6 +66,18 @@ app.whenReady().then(async () => {
|
|||
}
|
||||
const mocha = new Mocha(mochaOptions);
|
||||
|
||||
// Add a root hook on mocha to skip any tests that are disabled
|
||||
const disabledTests = new Set(
|
||||
JSON.parse(
|
||||
fs.readFileSync(path.join(__dirname, 'disabled-tests.json'), 'utf8')
|
||||
)
|
||||
);
|
||||
mocha.suite.beforeEach(function () {
|
||||
if (disabledTests.has(this.currentTest?.fullTitle())) {
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
||||
// The cleanup method is registered this way rather than through an
|
||||
// `afterEach` at the top level so that it can run before other `afterEach`
|
||||
// methods.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue