Skip to content

Commit 7e8dcf8

Browse files
committed
feat: Update test script to run Jest locally and CI commands conditionally
Signed-off-by: Gabryel Nóbrega <[email protected]>
1 parent c66b3ec commit 7e8dcf8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docusaurus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
1414
"write-heading-ids": "docusaurus write-heading-ids",
15-
"test": "yarn build:test && yarn check-links",
15+
"test": "node test.js",
1616
"build:test": "docusaurus build --no-minify --out-dir ./build_test",
1717
"check-links": "lychee ./build_test/**/*.html --exclude-mail --exclude './**/proposal/**'"
1818
},

docusaurus/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { execSync } = require('child_process');
2+
3+
const isCI = process.env.GITHUB_ACTIONS === 'true';
4+
5+
if (isCI) {
6+
execSync('yarn build:test && yarn check-links', { stdio: 'inherit' });
7+
} else {
8+
execSync('jest', { stdio: 'inherit' });
9+
}

0 commit comments

Comments
 (0)