fix: `import.meta.dirname` is not supported in v20.10.0

This commit is contained in:
zyoshoka 2025-05-04 16:31:48 +09:00
parent d004c928d5
commit e45372c9c1
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -1,15 +1,19 @@
#!/usr/bin/env node
import child_process from 'node:child_process';
import path from 'node:path';
import url from 'node:url';
import semver from 'semver';
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const args = [];
args.push(...[
...semver.satisfies(process.version, '^20.17.0 || ^22.0.0') ? ['--no-experimental-require-module'] : [],
'--experimental-vm-modules',
'--experimental-import-meta-resolve',
path.join(import.meta.dirname, 'node_modules/jest/bin/jest.js'),
path.join(__dirname, 'node_modules/jest/bin/jest.js'),
...process.argv.slice(2),
]);