Skip to content

Commit 8d7a6a0

Browse files
committed
address pr reviews
1 parent e663d82 commit 8d7a6a0

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
/tests/ts/fixture
77
/third_party
88
/tests/cpp/lit/**/*.json
9-
/tests/ts/e2e/default.test.ts
9+
/tests/as/default.test.ts
1010
/.cache
1111
/.github/CODEOWNERS

jest.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const config: JestConfigWithTsJest = {
1515
moduleNameMapper: {
1616
"^(\\.{1,2}/.*)\\.js$": "$1",
1717
},
18-
modulePathIgnorePatterns: ["tests/ts/e2e"],
1918
testPathIgnorePatterns: ["./dist"],
2019
testTimeout: 10000,
2120
};

src/core/execute.ts

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function nodeExecutor(wasms: string[], outFolder: string, imports: Imports) {
3030
...userDefinedImportsObject,
3131
} as ASImports;
3232
const binary = await readFile(wasm);
33-
// getting a list of wasm import functions
3433
const importList = await parseWasmImports(binary);
3534
// supplying default function here, so no more need to define all of them in as-test.js
3635
for (const imp of importList) {

src/utils/import.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,16 @@ export function covInstruFunc(wasm: string) {
8888
return { covInstrument };
8989
}
9090

91+
// list imports of a given wasm binary (buffer)
92+
// importList format should be as follows:
93+
// [
94+
// { module: 'env', name: 'memory', kind: 'memory' },
95+
// { module: 'env', name: 'myFunction', kind: 'function' },
96+
// ...
97+
// ]
9198
export async function parseWasmImports(binary: Buffer) {
92-
// list imports of a given wasm binary (buffer)
9399
const mod = await WebAssembly.compile(binary);
94-
95100
const importList = WebAssembly.Module.imports(mod);
96101

97-
// importList format should be as follows:
98-
// [
99-
// { module: 'env', name: 'memory', kind: 'memory' },
100-
// { module: 'env', name: 'myFunction', kind: 'function' },
101-
// ...
102-
// ]
103-
104102
return importList;
105103
}

tests/ts/e2e/default.test.ts renamed to tests/as/default.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, test, expect, endTest } from "../../../assembly";
1+
import { describe, test, expect, endTest } from "../../assembly";
22

33
// Default Stub Injection Tests
44
// Making sure that external functions can supplied with an empty default function so that users will be free of supplying their own

0 commit comments

Comments
 (0)