@@ -10,19 +10,20 @@ const outputDir = join(tmpdir(), "assemblyscript-unittest-framework");
10
10
11
11
test ( "Instrument" , async ( ) => {
12
12
await compile ( [ fixturePath ] , outputDir , "--memoryBase 16 --exportTable" ) ;
13
+ const base = join ( outputDir , "constructor" ) ;
13
14
const wasmPath = join ( outputDir , "constructor.wasm" ) ;
14
15
const sourceCodePath = "tests/ts/fixture/constructor.ts" ;
15
- const result = await instrument ( [ wasmPath ] , [ sourceCodePath ] ) ;
16
- expect ( result . length ) . toEqual ( 1 ) ;
16
+ const results = await instrument ( [ wasmPath ] , [ sourceCodePath ] ) ;
17
+ expect ( results . length ) . toEqual ( 1 ) ;
18
+ const result = results [ 0 ] ! ;
17
19
const instrumentedWasm = join ( outputDir , "constructor.instrumented.wasm" ) ;
18
20
const debugInfo = join ( outputDir , "constructor.debugInfo.json" ) ;
19
21
const expectInfo = join ( outputDir , "constructor.expectInfo.json" ) ;
20
- expect ( result [ 0 ] ) . toEqual ( {
21
- sourceWasm : wasmPath ,
22
- instrumentedWasm,
23
- debugInfo,
24
- expectInfo,
25
- } ) ;
22
+ expect ( result . baseName ) . toEqual ( base ) ;
23
+ expect ( result . sourceWasm ) . toEqual ( wasmPath ) ;
24
+ expect ( result . instrumentedWasm ) . toEqual ( instrumentedWasm ) ;
25
+ expect ( result . debugInfo ) . toEqual ( debugInfo ) ;
26
+ expect ( result . expectInfo ) . toEqual ( expectInfo ) ;
26
27
expect ( fs . existsSync ( instrumentedWasm ) ) . toEqual ( true ) ;
27
28
expect ( fs . existsSync ( debugInfo ) ) . toEqual ( true ) ;
28
29
expect ( fs . existsSync ( expectInfo ) ) . toEqual ( true ) ;
0 commit comments