-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshots for nodejs-module target
- Loading branch information
1 parent
bf3fade
commit 90dfbfe
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
crates/cli-support/tests/snapshots/test_add__nodejs_module_js.snap
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,8 @@ | ||
--- | ||
source: crates/cli-support/tests/test_add.rs | ||
expression: output.js() | ||
--- | ||
let wasm; | ||
export function __wbg_set_wasm(val) { | ||
wasm = val; | ||
} |
20 changes: 20 additions & 0 deletions
20
crates/cli-support/tests/snapshots/test_add__nodejs_module_start.snap
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,20 @@ | ||
--- | ||
source: crates/cli-support/tests/test_add.rs | ||
expression: output.start().unwrap() | ||
--- | ||
let imports = {}; | ||
|
||
import * as path from 'node:path'; | ||
import * as fs from 'node:fs'; | ||
import * as process from 'node:process'; | ||
|
||
let file = path.dirname(new URL(import.meta.url).pathname); | ||
if (process.platform === 'win32') { | ||
file = file.substring(1); | ||
} | ||
const bytes = fs.readFileSync(path.join(file, 'add_bg.wasm')); | ||
|
||
const wasmModule = new WebAssembly.Module(bytes); | ||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports); | ||
const wasm = wasmInstance.exports; | ||
export const __wasm = wasm; |
8 changes: 8 additions & 0 deletions
8
crates/cli-support/tests/snapshots/test_native_add__nodejs_module_js.snap
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,8 @@ | ||
--- | ||
source: crates/cli-support/tests/test_native_add.rs | ||
expression: output.js() | ||
--- | ||
let wasm; | ||
export function __wbg_set_wasm(val) { | ||
wasm = val; | ||
} |
22 changes: 22 additions & 0 deletions
22
crates/cli-support/tests/snapshots/test_native_add__nodejs_module_start.snap
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,22 @@ | ||
--- | ||
source: crates/cli-support/tests/test_native_add.rs | ||
expression: output.start().unwrap() | ||
--- | ||
let imports = {}; | ||
import * as import0 from 'env'; | ||
imports['env'] = import0; | ||
|
||
import * as path from 'node:path'; | ||
import * as fs from 'node:fs'; | ||
import * as process from 'node:process'; | ||
|
||
let file = path.dirname(new URL(import.meta.url).pathname); | ||
if (process.platform === 'win32') { | ||
file = file.substring(1); | ||
} | ||
const bytes = fs.readFileSync(path.join(file, 'native_add_bg.wasm')); | ||
|
||
const wasmModule = new WebAssembly.Module(bytes); | ||
const wasmInstance = new WebAssembly.Instance(wasmModule, imports); | ||
const wasm = wasmInstance.exports; | ||
export const __wasm = wasm; |
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