@@ -3,6 +3,31 @@ import * as fixtures from '../common/fixtures.mjs';
33import { match , strictEqual } from 'node:assert' ;
44import { test } from 'node:test' ;
55
6+ test ( 'expect process.features.typescript to be \'strip\' when --experimental-strip-types' , async ( ) => {
7+ const result = await spawnPromisified ( process . execPath , [
8+ '--no-warnings' ,
9+ '--experimental-strip-types' ,
10+ fixtures . path ( 'typescript/echo-process-features-typescript.cjs' ) ,
11+ ] ) ;
12+
13+ strictEqual ( result . stderr , '' ) ;
14+ strictEqual ( result . stdout , process . config . variables . node_use_amaro ? 'strip\n' : 'false\n' ) ;
15+ strictEqual ( result . code , 0 ) ;
16+ } ) ;
17+
18+ test ( 'expect process.features.typescript to be \'transform\' when --experimental-transform-types' , async ( ) => {
19+ const result = await spawnPromisified ( process . execPath , [
20+ '--no-warnings' ,
21+ '--experimental-transform-types' ,
22+ fixtures . path ( 'typescript/echo-process-features-typescript.cjs' ) ,
23+ ] ) ;
24+
25+ strictEqual ( result . stderr , '' ) ;
26+ strictEqual ( result . stdout , process . config . variables . node_use_amaro ? 'transform\n' : 'false\n' ) ;
27+ strictEqual ( result . code , 0 ) ;
28+ } ) ;
29+
30+
631if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
732
833test ( 'execute a TypeScript file' , async ( ) => {
@@ -354,30 +379,6 @@ test('execute a TypeScript test mocking module', { skip: isWindows && process.ar
354379 strictEqual ( result . code , 0 ) ;
355380} ) ;
356381
357- test ( 'expect process.features.typescript to be \'strip\' when --experimental-strip-types' , async ( ) => {
358- const result = await spawnPromisified ( process . execPath , [
359- '--no-warnings' ,
360- '--experimental-strip-types' ,
361- '-p' , 'process.features.typescript' ,
362- ] ) ;
363-
364- strictEqual ( result . stderr , '' ) ;
365- strictEqual ( result . stdout , 'strip\n' ) ;
366- strictEqual ( result . code , 0 ) ;
367- } ) ;
368-
369- test ( 'expect process.features.typescript to be \'transform\' when --experimental-transform-types' , async ( ) => {
370- const result = await spawnPromisified ( process . execPath , [
371- '--no-warnings' ,
372- '--experimental-transform-types' ,
373- '-p' , 'process.features.typescript' ,
374- ] ) ;
375-
376- strictEqual ( result . stderr , '' ) ;
377- strictEqual ( result . stdout , 'transform\n' ) ;
378- strictEqual ( result . code , 0 ) ;
379- } ) ;
380-
381382test ( 'expect process.features.typescript to be false without type-stripping' , async ( ) => {
382383 strictEqual ( process . features . typescript , false ) ;
383384} ) ;
0 commit comments