mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 17:03:34 +00:00

PR-URL: https://github.com/nodejs/node/pull/55698 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
50 lines
2.0 KiB
JavaScript
50 lines
2.0 KiB
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const fixtures = require('../common/fixtures.js');
|
|
const { spawnSyncAndAssert } = require('../common/child_process.js');
|
|
|
|
spawnSyncAndAssert(process.execPath,
|
|
[
|
|
'--require',
|
|
fixtures.path('module-hooks', 'register-typescript-hooks.js'),
|
|
fixtures.path('module-hooks', 'log-user.cts'),
|
|
], {
|
|
trim: true,
|
|
stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }',
|
|
});
|
|
|
|
spawnSyncAndAssert(process.execPath,
|
|
[
|
|
'--experimental-strip-types',
|
|
'--no-experimental-transform-types',
|
|
'--require',
|
|
fixtures.path('module-hooks', 'register-typescript-hooks.js'),
|
|
fixtures.path('module-hooks', 'log-user.cts'),
|
|
], {
|
|
trim: true,
|
|
stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }',
|
|
});
|
|
|
|
spawnSyncAndAssert(process.execPath,
|
|
[
|
|
'--import',
|
|
fixtures.fileURL('module-hooks', 'register-typescript-hooks.js'),
|
|
fixtures.path('module-hooks', 'log-user.mts'),
|
|
], {
|
|
trim: true,
|
|
stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }',
|
|
});
|
|
|
|
spawnSyncAndAssert(process.execPath,
|
|
[
|
|
'--experimental-strip-types',
|
|
'--no-experimental-transform-types',
|
|
'--import',
|
|
fixtures.fileURL('module-hooks', 'register-typescript-hooks.js'),
|
|
fixtures.path('module-hooks', 'log-user.mts'),
|
|
], {
|
|
trim: true,
|
|
stdout: 'UserAccount { name: \'john\', id: 100, type: 1 }',
|
|
});
|