forked from webpack/webpack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepareSuite.js
More file actions
28 lines (25 loc) · 789 Bytes
/
Copy pathprepareSuite.js
File metadata and controls
28 lines (25 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// eslint-disable-next-line node/no-unpublished-require
const execa = require("execa");
// eslint-disable-next-line node/no-unpublished-require
const { red, green } = require("colorette");
const collectTestFolders = require("./utils");
const PACKAGE = "package.json";
const getFoldersWithPackage = (stats, file) => {
return stats.isFile() && file === PACKAGE;
};
(async () => {
try {
const folders = collectTestFolders(getFoldersWithPackage);
for (const folder of folders) {
await execa("yarn", {
cwd: folder,
stdio: "inherit",
});
}
console.log(green(" Successfully prepared the test suite "));
} catch (e) {
console.error(red(" Unable to prepare the test suite "));
console.error(e.stack);
process.exitCode = 1;
}
})();