From 346868f78bdd7c51ef433dcf2bdaaac6ec80ca1f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 May 2019 10:32:14 -0700 Subject: [PATCH] Fix a failing CLI test --- crates/cli-support/src/js/mod.rs | 3 ++- crates/cli/tests/wasm-bindgen/npm.rs | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 830fd025..0814a9fa 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -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(), ); } diff --git a/crates/cli/tests/wasm-bindgen/npm.rs b/crates/cli/tests/wasm-bindgen/npm.rs index 1572a939..2ad9e66f 100644 --- a/crates/cli/tests/wasm-bindgen/npm.rs +++ b/crates/cli/tests/wasm-bindgen/npm.rs @@ -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(); }