Skip to content

Commit 787ffc9

Browse files
committed
fix test
1 parent 64b2fef commit 787ffc9

File tree

1 file changed

+8
-5
lines changed
  • crates/cli/tests/wasm-bindgen

1 file changed

+8
-5
lines changed

crates/cli/tests/wasm-bindgen/main.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,17 @@ fn default_module_path_target_no_modules() {
258258
cmd.assert().success();
259259
let contents =
260260
fs::read_to_string(out_dir.join("default_module_path_target_no_modules.js")).unwrap();
261+
assert!(contents.contains(
262+
"\
263+
if (typeof document === 'undefined') {
264+
script_src = location.href;
265+
} else {
266+
script_src = document.currentScript.src;
267+
}",
268+
));
261269
assert!(contents.contains(
262270
"\
263271
async function init(input) {
264-
if (typeof document === 'undefined') {
265-
script_src = location.href;
266-
} else {
267-
script_src = document.currentScript.src;
268-
}
269272
if (typeof input === 'undefined') {
270273
input = script_src.replace(/\\.js$/, '_bg.wasm');
271274
}",

0 commit comments

Comments
 (0)