-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathrun-checks.js
More file actions
40 lines (35 loc) · 823 Bytes
/
run-checks.js
File metadata and controls
40 lines (35 loc) · 823 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
29
30
31
32
33
34
35
36
37
38
39
40
import { execSync } from 'node:child_process';
const TESTABLE_PLUGINS = [
'star-rating-editor',
'yandex-translate',
'todo-list',
'tag-editor',
'lorem-ipsum',
'notes',
'conditional-fields',
'shopify-product',
'commercelayer',
];
const runTests = (path) => {
const root = process.cwd();
process.chdir(path);
execSync('npm i', { stdio: [0, 1, 2] });
let testExitCode = 0;
try {
execSync('npm run lint && npm run dist', { stdio: [0, 1, 2] });
} catch (_error) {
testExitCode = 1;
} finally {
process.chdir(root);
}
return testExitCode;
};
let finalExitCode = 0;
for (const path of TESTABLE_PLUGINS) {
console.log(`\nRunning tests for '${path}'`);
const testExitCode = runTests(path);
if (testExitCode !== 0) {
finalExitCode = 1;
}
}
process.exit(finalExitCode);