@@ -3,6 +3,31 @@ import * as fixtures from '../common/fixtures.mjs';
3
3
import { match , strictEqual } from 'node:assert' ;
4
4
import { test } from 'node:test' ;
5
5
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
+
6
31
if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7
32
8
33
test ( 'execute a TypeScript file' , async ( ) => {
@@ -353,30 +378,6 @@ test('execute a TypeScript test mocking module', { skip: isWindows && process.ar
353
378
strictEqual ( result . code , 0 ) ;
354
379
} ) ;
355
380
356
- test ( 'expect process.features.typescript to be \'strip\' when --experimental-strip-types' , async ( ) => {
357
- const result = await spawnPromisified ( process . execPath , [
358
- '--no-warnings' ,
359
- '--experimental-strip-types' ,
360
- '-p' , 'process.features.typescript' ,
361
- ] ) ;
362
-
363
- strictEqual ( result . stderr , '' ) ;
364
- strictEqual ( result . stdout , 'strip\n' ) ;
365
- strictEqual ( result . code , 0 ) ;
366
- } ) ;
367
-
368
- test ( 'expect process.features.typescript to be \'transform\' when --experimental-transform-types' , async ( ) => {
369
- const result = await spawnPromisified ( process . execPath , [
370
- '--no-warnings' ,
371
- '--experimental-transform-types' ,
372
- '-p' , 'process.features.typescript' ,
373
- ] ) ;
374
-
375
- strictEqual ( result . stderr , '' ) ;
376
- strictEqual ( result . stdout , 'transform\n' ) ;
377
- strictEqual ( result . code , 0 ) ;
378
- } ) ;
379
-
380
381
test ( 'expect process.features.typescript to be false without type-stripping' , async ( ) => {
381
382
strictEqual ( process . features . typescript , false ) ;
382
383
} ) ;
0 commit comments