Skip to content

Commit

Permalink
feat: remove node 21 usage on test [no issue] (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
theohdv committed Jan 8, 2024
1 parent cc19674 commit 6b8ecb8
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions @ornikar/jest-config/bin/ornikar-run-jest.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
#!/usr/bin/env node

import { spawnSync } from 'node:child_process';
import { lt } from 'semver';

const nodeVersion = process.versions.node;

if (lt(nodeVersion, '21.1.0')) {
console.warn(
`WARNING: Use node version >= 21.1.0 to fix issue with jest. Actual: ${nodeVersion}. For more information, see https://github.com/jestjs/jest/issues/11956\n\n`,
);
spawnSync(
process.execPath,
[...process.execArgv, '--no-compilation-cache', 'node_modules/jest/bin/jest.js', ...process.argv.slice(2)],
{
stdio: 'inherit',
},
);
} else {
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'test';
}
import('jest').then((module) => module.default.run());
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'test';
}
import('jest').then((module) => module.default.run());

0 comments on commit 6b8ecb8

Please sign in to comment.