1
1
const fs = require ( "fs" ) ;
2
2
const assert = require ( "assert" ) ;
3
- const asbind = require ( "../dist/asbind.cjs" ) ;
3
+ const { AsBind } = require ( "../dist/asbind.cjs" ) ;
4
4
5
5
const wasmBytes = new Uint8Array ( fs . readFileSync ( "./test/assembly/test.wasm" ) ) ;
6
6
@@ -26,7 +26,7 @@ describe("asbind", () => {
26
26
describe ( "instantiation" , ( ) => {
27
27
it ( "should instantiate WebAssembly.Module" , async ( ) => {
28
28
const wasmModule = await WebAssembly . compile ( wasmBytes ) ;
29
- asbindInstance = await asbind . instantiate ( wasmModule , baseImportObject ) ;
29
+ asbindInstance = await AsBind . instantiate ( wasmModule , baseImportObject ) ;
30
30
31
31
assert ( asbindInstance . exports !== undefined , true ) ;
32
32
assert ( asbindInstance . exports . helloWorld !== undefined , true ) ;
@@ -35,7 +35,7 @@ describe("asbind", () => {
35
35
} ) ;
36
36
37
37
it ( "should instantiate Uint8Array" , async ( ) => {
38
- asbindInstance = await asbind . instantiate ( wasmBytes , baseImportObject ) ;
38
+ asbindInstance = await AsBind . instantiate ( wasmBytes , baseImportObject ) ;
39
39
40
40
assert ( asbindInstance . exports !== undefined , true ) ;
41
41
assert ( asbindInstance . exports . helloWorld !== undefined , true ) ;
@@ -56,7 +56,7 @@ describe("asbind", () => {
56
56
} ) ;
57
57
} ;
58
58
59
- asbindInstance = await asbind . instantiate (
59
+ asbindInstance = await AsBind . instantiate (
60
60
Promise . resolve ( {
61
61
bytes : wasmBytes
62
62
} ) ,
@@ -74,7 +74,7 @@ describe("asbind", () => {
74
74
let asbindInstance ;
75
75
76
76
before ( async ( ) => {
77
- asbindInstance = await asbind . instantiate ( wasmBytes , baseImportObject ) ;
77
+ asbindInstance = await AsBind . instantiate ( wasmBytes , baseImportObject ) ;
78
78
} ) ;
79
79
80
80
it ( "should allow passing high level types to asbind instance exports" , ( ) => {
@@ -171,7 +171,7 @@ describe("asbind", () => {
171
171
}
172
172
} ;
173
173
174
- asbindInstance = await asbind . instantiate (
174
+ asbindInstance = await AsBind . instantiate (
175
175
wasmBytes ,
176
176
wrappedBaseImportObject
177
177
) ;
@@ -245,7 +245,7 @@ describe("asbind", () => {
245
245
}
246
246
} ;
247
247
248
- asbindInstance = await asbind . instantiate (
248
+ asbindInstance = await AsBind . instantiate (
249
249
wasmBytes ,
250
250
wrappedBaseImportObject
251
251
) ;
0 commit comments