Fix a failing CLI test

This commit is contained in:
Alex Crichton 2019-05-30 10:32:14 -07:00
parent 22b26db911
commit 346868f78b
2 changed files with 11 additions and 5 deletions

View File

@ -1982,7 +1982,8 @@ impl<'a> Context<'a> {
if !self.config.mode.nodejs() && !self.config.mode.bundler() {
bail!(
"NPM dependencies have been specified in `{}` but \
this is only compatible with the `bundler` and `nodejs` targets"
this is only compatible with the `bundler` and `nodejs` targets",
path.display(),
);
}

View File

@ -22,10 +22,15 @@ fn no_modules_rejects_npm() {
.file("package.json", "")
.wasm_bindgen("--no-modules");
cmd.assert()
.stderr("\
error: failed to generate bindings for JS import `foo`
caused by: import from `foo` module not allowed with `--target no-modules`; use `nodejs`, `web`, or `bundler` target instead
")
.stderr(
str::is_match(
"\
error: NPM dependencies have been specified in `.*` but this is only \
compatible with the `bundler` and `nodejs` targets
",
)
.unwrap(),
)
.failure();
}