Skip to content

Commit

Permalink
add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
a1trl9 committed Mar 30, 2020
1 parent 0716a25 commit 72a19e0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions crates/cli/tests/wasm-bindgen/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,34 @@ fn works_on_empty_project() {
cmd.assert().success();
}

#[test]
fn namespace_global_and_noglobal_works() {
let (mut cmd, _out_dir) = Project::new("namespace_global_and_noglobal_works")
.file(
"src/lib.rs",
r#"
use wasm_bindgen::prelude::*;
#[wasm_bindgen(module = "fs")]
extern "C" {
#[wasm_bindgen(js_namespace = window)]
fn t1();
}
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = window)]
fn t2();
}
#[wasm_bindgen]
pub fn test() {
t1();
t2();
}
"#,
)
.wasm_bindgen("");
cmd.assert().success();
}

mod npm;

#[test]
Expand Down

0 comments on commit 72a19e0

Please sign in to comment.