Skip to content

Commit f3157d4

Browse files
committed
chore: Use process.cwd() instead of __dirname or import.meta
While this doesn't have the exact same semantic, it works identical in all Node.js versions and we have control of the cwd of the process, so this should be consistent and work without ESM/CJS trics.
1 parent aad53d6 commit f3157d4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/cli-repl/src/run.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ import path from 'path';
33
import { promisify } from 'util';
44
import { expect } from 'chai';
55
import { once } from 'events';
6+
import process from 'process';
67
const execFile = promisify(childProcess.execFile);
78

8-
const __dirname = import.meta.dirname;
9+
const __dirname: string = path.join(
10+
process.cwd(),
11+
'packages',
12+
'cli-repl',
13+
'src'
14+
);
915

1016
describe('CLI entry point', function () {
1117
const pathToRun = [

0 commit comments

Comments
 (0)