This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61b2ac8
commit 32b4d86
Showing
7 changed files
with
95 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { myValue } from './test.wasm'; | ||
|
||
console.log(myValue.valueOf()); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { testSuite, expect } from 'manten'; | ||
import type { NodeApis } from '../utils/node-with-loader'; | ||
|
||
export default testSuite(async ({ describe }, node: NodeApis) => { | ||
describe('WASM', async ({ test }) => { | ||
const importPath = './lib/wasm/index.js'; | ||
|
||
test('Unsupported extension error', async () => { | ||
const nodeProcess = await node.load(importPath); | ||
|
||
expect(nodeProcess.exitCode).toBe(1); | ||
expect(nodeProcess.stderr).toMatch('ERR_UNKNOWN_FILE_EXTENSION'); | ||
}); | ||
|
||
test('Loads with experimental flag', async () => { | ||
const nodeProcess = await node.load(importPath, { | ||
nodeOptions: ['--experimental-wasm-modules'], | ||
}); | ||
|
||
expect(nodeProcess.exitCode).toBe(0); | ||
expect(nodeProcess.stdout).toBe('1234'); | ||
}); | ||
}); | ||
}); |