test: add disabled tests list (#37334)
This commit is contained in:
parent
87f2a1d572
commit
1f390119fe
2 changed files with 16 additions and 0 deletions
3
spec/disabled-tests.json
Normal file
3
spec/disabled-tests.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[
|
||||||
|
"// NOTE: this file is used to disable tests in our test suite by their full title."
|
||||||
|
]
|
|
@ -1,3 +1,4 @@
|
||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const v8 = require('v8');
|
const v8 = require('v8');
|
||||||
|
|
||||||
|
@ -65,6 +66,18 @@ app.whenReady().then(async () => {
|
||||||
}
|
}
|
||||||
const mocha = new Mocha(mochaOptions);
|
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
|
// The cleanup method is registered this way rather than through an
|
||||||
// `afterEach` at the top level so that it can run before other `afterEach`
|
// `afterEach` at the top level so that it can run before other `afterEach`
|
||||||
// methods.
|
// methods.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue