Skip to content

Commit 346868f

Browse files
committed
Fix a failing CLI test
1 parent 22b26db commit 346868f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,8 @@ impl<'a> Context<'a> {
19821982
if !self.config.mode.nodejs() && !self.config.mode.bundler() {
19831983
bail!(
19841984
"NPM dependencies have been specified in `{}` but \
1985-
this is only compatible with the `bundler` and `nodejs` targets"
1985+
this is only compatible with the `bundler` and `nodejs` targets",
1986+
path.display(),
19861987
);
19871988
}
19881989

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ fn no_modules_rejects_npm() {
2222
.file("package.json", "")
2323
.wasm_bindgen("--no-modules");
2424
cmd.assert()
25-
.stderr("\
26-
error: failed to generate bindings for JS import `foo`
27-
caused by: import from `foo` module not allowed with `--target no-modules`; use `nodejs`, `web`, or `bundler` target instead
28-
")
25+
.stderr(
26+
str::is_match(
27+
"\
28+
error: NPM dependencies have been specified in `.*` but this is only \
29+
compatible with the `bundler` and `nodejs` targets
30+
",
31+
)
32+
.unwrap(),
33+
)
2934
.failure();
3035
}
3136

0 commit comments

Comments
 (0)