Skip to content

Commit 47037af

Browse files
authored
Fix some test-related issues (#419)
* Add empty `imports.wit` for `exports_only` test Otherwise the build process thinks this is always missing so tests are always slowly rebuilt. * Fix compiling the `runtime` test for JS in isolation This requires the `clap` feature to be enabled now which works with `cargo test --workspace` but isn't working with individual crate testing. * Don't test wasm size in exports_only test Different versions of `wasi-libc` will produce differently sized binaries, so only test the generated JS which this repo controls.
1 parent b0a34f0 commit 47037af

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

crates/gen-host-js/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ base64 = "0.13.1"
2020

2121
[dev-dependencies]
2222
test-helpers = { path = '../test-helpers' }
23+
24+
[[test]]
25+
name = "runtime"
26+
required-features = ["clap"]

tests/runtime/exports_only/host.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --base64 --nodejs-compat --valid-lifting-optimization
1+
// Flags: --nodejs-compat --valid-lifting-optimization
22
// @ts-ignore
33
import { ok, strictEqual } from 'assert';
44
// @ts-ignore
@@ -13,6 +13,6 @@ strictEqual(result, 'test');
1313
// Verify the inlined file size does not regress
1414
const url = new URL('./exports_only.js', import.meta.url);
1515
const jsSource = await readFile(url);
16-
const max_size = 6442;
16+
const max_size = 1105;
1717
ok(jsSource.byteLength <= max_size, `JS inlined bytelength ${jsSource.byteLength} is greater than ${max_size} bytes, at ${fileURLToPath(url)}`);
1818

tests/runtime/exports_only/imports.wit

Whitespace-only changes.

0 commit comments

Comments
 (0)