skip worker tests when worker_threads is not supported

This commit is contained in:
Tobias Koppers 2020-11-28 19:12:32 +01:00
parent a0d72e6e8c
commit 4c3e18fb39
2 changed files with 13 additions and 5 deletions

View File

@ -27,15 +27,18 @@ const describeCases = config => {
categories.forEach(category => {
describe(category.name, () => {
category.tests.forEach(testName => {
const testDirectory = path.join(casesPath, category.name, testName);
const filterPath = path.join(testDirectory, "test.filter.js");
if (fs.existsSync(filterPath) && !require(filterPath)()) {
describe.skip(testName, () => {
it("filtered", () => {});
});
return;
}
describe(testName, () => {
it(
testName + " should compile",
done => {
const testDirectory = path.join(
casesPath,
category.name,
testName
);
const outputDirectory = path.join(
__dirname,
"js",

View File

@ -0,0 +1,5 @@
var supportsWorker = require("../../../helpers/supportsWorker");
module.exports = function (config) {
return supportsWorker();
};