Skip to content

Commit 8e36ffd

Browse files
committed
chore: use --no-experimental-strip-types in 24.11.1
1 parent 9d4bed1 commit 8e36ffd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ import path from 'path';
33
import { promisify } from 'util';
44
import { expect } from 'chai';
55
import { once } from 'events';
6-
import process from 'process';
76
const execFile = promisify(childProcess.execFile);
87

9-
const __DIRNAME = path.resolve(path.join(process.cwd(), 'src'));
10-
118
describe('CLI entry point', function () {
129
const pathToRun = [
1310
'-r',
1411
'ts-node/register',
15-
path.resolve(__DIRNAME, 'run.ts'),
12+
path.resolve(__dirname, 'run.ts'),
1613
];
1714
async function run(
1815
args: string[],
@@ -42,7 +39,7 @@ describe('CLI entry point', function () {
4239

4340
it('runs Node.js scripts if MONGOSH_RUN_NODE_SCRIPT is passed', async function () {
4441
const { stdout } = await run(
45-
[path.resolve(__DIRNAME, '..', 'test', 'fixtures', 'nodescript.js')],
42+
[path.resolve(__dirname, '..', 'test', 'fixtures', 'nodescript.js')],
4643
{ MONGOSH_RUN_NODE_SCRIPT: '1' }
4744
);
4845
expect(stdout).to.include('works!');

scripts/run-if-package-requested.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ if (process.env.MONGOSH_RUN_ONLY_IN_PACKAGE && process.env.MONGOSH_RUN_ONLY_IN_P
77
`${packageDir} is not ${process.env.MONGOSH_RUN_ONLY_IN_PACKAGE}, skipping "${process.argv.slice(2).join(' ')}"\n`);
88
return;
99
}
10+
11+
let parentEnv = process.env;
12+
if (process.version.startsWith("v24")) {
13+
parentEnv.NODE_OPTIONS = `${parentEnv.NODE_OPTIONS} --no-experimental-strip-types`;
14+
}
15+
1016
const child_process = require('child_process');
11-
child_process.spawn(process.argv[2], process.argv.slice(3), { stdio: 'inherit', shell: process.platform === 'win32' })
17+
child_process.spawn(process.argv[2], process.argv.slice(3), { stdio: 'inherit', shell: process.platform === 'win32', env: parentEnv })
1218
.on('exit', (code, signal) => {
1319
if (signal) {
1420
process.kill(process.pid, signal);

0 commit comments

Comments
 (0)