Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ fn main() {
println!("cargo:rerun-if-changed=providers/javy_quickjs_provider_v1.wasm");
println!("cargo:rerun-if-changed=providers/javy_quickjs_provider_v2.wasm");
println!("cargo:rerun-if-changed=providers/javy_quickjs_provider_v3.wasm");
println!("cargo:rerun-if-changed=providers/shopify_functions_javy_v1.wasm");
}
Binary file added providers/shopify_functions_javy_v1.wasm
Binary file not shown.
15 changes: 15 additions & 0 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,21 @@ mod tests {
assert_eq!(function_run_result.unwrap().memory_usage, 1344);
}

#[test]
fn test_js_functions_javy_v1() {
let input = include_bytes!("../tests/fixtures/input/js_function_input.json").to_vec();
let function_run_result = run(FunctionRunParams {
function_path: Path::new("tests/fixtures/build/js_functions_javy_v1.wasm")
.to_path_buf(),
input,
export: DEFAULT_EXPORT,
..Default::default()
});

assert!(function_run_result.is_ok());
assert_eq!(function_run_result.unwrap().memory_usage, 1344);
}

#[test]
fn test_exit_code_zero() {
let function_run_result = run(FunctionRunParams {
Expand Down
6 changes: 5 additions & 1 deletion tests/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ cargo wasi build --profile=wasm -p exit_code -p exports -p log_truncation_functi
```

**JS examples:**

js_function_v2.wasm:
```
javy compile -d -o tests/fixtures/build/js_function_v2.wasm tests/fixtures/js_function/src/functions.js
Expand All @@ -27,6 +26,11 @@ js_function_v3.wasm:
javy build -C dynamic -C plugin=providers/javy_quickjs_provider_v3.wasm -o tests/fixtures/build/js_function_v3.wasm tests/fixtures/js_function/src/functions.js
```

js_functions_javy_v1.wasm:
```
javy build -C dynamic -C plugin=providers/shopify_functions_javy_v1.wasm -o tests/fixtures/build/js_functions_javy_v1.wasm tests/fixtures/js_function/src/functions.js
```

**`*.wat` examples:**
```
find tests/fixtures -maxdepth 1 -type f -name "*.wat" \
Expand Down
Binary file added tests/fixtures/build/js_functions_javy_v1.wasm
Binary file not shown.
Loading