Skip to content

Commit 09e8f8c

Browse files
committed
test: assert CLI runs without warnings
1 parent 1d7e528 commit 09e8f8c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/specs/version-sensitive.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ import { createPackageJson } from '../fixtures';
88
// Run on every Node version in the CI matrix.
99
export const versionSensitiveTests = (node: NodeApis) => describe('Version-sensitive', () => {
1010
if (node.supports.moduleRegisterHooksCjsReload) {
11+
test('CLI runs without warnings', async () => {
12+
await using fixture = await createFixture({
13+
'package.json': createPackageJson({ type: 'module' }),
14+
'index.ts': 'console.log("loaded" as string)',
15+
});
16+
17+
const { exitCode, stderr, stdout } = await node.tsx(['index.ts'], {
18+
cwd: fixture.path,
19+
env: {
20+
NODE_OPTIONS: '--throw-deprecation',
21+
},
22+
});
23+
expect(exitCode).toBe(0);
24+
expect(stderr).toBe('');
25+
expect(stdout).toBe('loaded');
26+
});
27+
1128
test('ESM loader avoids module.register deprecation', async () => {
1229
await using fixture = await createFixture({
1330
'package.json': createPackageJson({ type: 'module' }),

0 commit comments

Comments
 (0)