diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 451b7c2195e7ad..669cab75d35450 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -1571,6 +1571,11 @@ function getMaybeCachedSource(mod, filename) { return content; } +/** + * Built-in handler for `.cts` files. + * @param {Module} module The module to compile + * @param {string} filename The file path of the module + */ function loadCTS(module, filename) { if (isUnderNodeModules(filename)) { throw new ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING(filename); diff --git a/test/es-module/test-typescript-eval.mjs b/test/es-module/test-typescript-eval.mjs index 120b66a1d26017..be467721577826 100644 --- a/test/es-module/test-typescript-eval.mjs +++ b/test/es-module/test-typescript-eval.mjs @@ -98,7 +98,7 @@ test('expect fail eval TypeScript CommonJS syntax with input-type module', async strictEqual(result.code, 1); }); -test('expect fail eval TypeScript CommonJS syntax with input-type module', async () => { +test('expect fail eval TypeScript ESM syntax with input-type commonjs', async () => { const result = await spawnPromisified(process.execPath, [ '--experimental-strip-types', '--input-type=commonjs', diff --git a/test/es-module/test-typescript.mjs b/test/es-module/test-typescript.mjs index 0a713a36e42ace..d01623cec37a4e 100644 --- a/test/es-module/test-typescript.mjs +++ b/test/es-module/test-typescript.mjs @@ -276,7 +276,7 @@ test('execute a TypeScript file with CommonJS syntax requiring .mts', async () = strictEqual(result.code, 1); }); -test('execute a TypeScript file with CommonJS syntax requiring .mts with require-module', async () => { +test('execute a TypeScript file with CommonJS syntax requiring .mts using require-module', async () => { const result = await spawnPromisified(process.execPath, [ '--experimental-strip-types', '--experimental-require-module', @@ -288,7 +288,7 @@ test('execute a TypeScript file with CommonJS syntax requiring .mts with require strictEqual(result.code, 0); }); -test('execute a TypeScript file with CommonJS syntax requiring .mts with require-module', async () => { +test('execute a TypeScript file with CommonJS syntax requiring .cts using commonjs', async () => { const result = await spawnPromisified(process.execPath, [ '--experimental-strip-types', '--no-warnings',