@@ -3,34 +3,34 @@ import { Imports as ASImports } from "@assemblyscript/loader";
3
3
4
4
const mockWriteFile = jest . fn ( ) ;
5
5
jest . unstable_mockModule ( "node:fs" , ( ) => ( {
6
- writeFileSync : mockWriteFile ,
6
+ writeFileSync : mockWriteFile ,
7
7
} ) ) ;
8
8
9
9
const { supplyDefaultFunction } = await import ( "../../../../src/utils/index.js" ) ;
10
10
11
11
describe ( "supplyDefaultFunction" , ( ) => {
12
- test ( "supplyTest" , ( ) => {
13
- const mockImportList : WebAssembly . ModuleImportDescriptor [ ] = [
14
- { kind : "function" , module : "myenv" , name : "processEvent" } ,
15
- { kind : "function" , module : "externalMath" , name : "add" } ,
16
- { kind : "function" , module : "system" , name : "getStatus" } ,
17
- { kind : "function" , module : "logger" , name : "logWarning" } ,
18
- { kind : "function" , module : "customOps" , name : "combineValues" } ,
19
- ] ;
12
+ test ( "supplyTest" , ( ) => {
13
+ const mockImportList : WebAssembly . ModuleImportDescriptor [ ] = [
14
+ { kind : "function" , module : "myenv" , name : "processEvent" } ,
15
+ { kind : "function" , module : "externalMath" , name : "add" } ,
16
+ { kind : "function" , module : "system" , name : "getStatus" } ,
17
+ { kind : "function" , module : "logger" , name : "logWarning" } ,
18
+ { kind : "function" , module : "customOps" , name : "combineValues" } ,
19
+ ] ;
20
20
21
- const mockImportObject : ASImports = {
22
- myenv : { } ,
23
- externalMath : { } ,
24
- system : { } ,
25
- logger : { } ,
26
- customOps : { } ,
27
- } ;
21
+ const mockImportObject : ASImports = {
22
+ myenv : { } ,
23
+ externalMath : { } ,
24
+ system : { } ,
25
+ logger : { } ,
26
+ customOps : { } ,
27
+ } ;
28
28
29
- supplyDefaultFunction ( mockImportList , mockImportObject ) ;
29
+ supplyDefaultFunction ( mockImportList , mockImportObject ) ;
30
30
31
- expect ( typeof mockImportObject [ "myenv" ] ?. [ "processEvent" ] ) . toBe ( "function" ) ;
32
- expect ( typeof mockImportObject [ "system" ] ?. [ "getStatus" ] ) . toBe ( "function" ) ;
33
- expect ( typeof mockImportObject [ "logger" ] ?. [ "logWarning" ] ) . toBe ( "function" ) ;
34
- expect ( typeof mockImportObject [ "customOps" ] ?. [ "combineValues" ] ) . toBe ( "function" ) ;
35
- } ) ;
36
- } ) ;
31
+ expect ( typeof mockImportObject [ "myenv" ] ?. [ "processEvent" ] ) . toBe ( "function" ) ;
32
+ expect ( typeof mockImportObject [ "system" ] ?. [ "getStatus" ] ) . toBe ( "function" ) ;
33
+ expect ( typeof mockImportObject [ "logger" ] ?. [ "logWarning" ] ) . toBe ( "function" ) ;
34
+ expect ( typeof mockImportObject [ "customOps" ] ?. [ "combineValues" ] ) . toBe ( "function" ) ;
35
+ } ) ;
36
+ } ) ;
0 commit comments