Skip to content

Commit 74a39ce

Browse files
authored
Merge pull request #1280 from alexcrichton/rename-context
Rename test `Context` in JS
2 parents de85d99 + 7fbe021 commit 74a39ce

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

crates/cli/src/bin/wasm-bindgen-test-runner/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn execute(
4444
const support = require("./{0}");
4545
const wasm = require("./{0}_bg");
4646
47-
cx = new support.Context();
47+
cx = new support.WasmBindgenTestContext();
4848
handlers.on_console_debug = support.__wbgtest_console_debug;
4949
handlers.on_console_log = support.__wbgtest_console_log;
5050
handlers.on_console_info = support.__wbgtest_console_info;

crates/cli/src/bin/wasm-bindgen-test-runner/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn spawn(
1818
let mut js_to_execute = format!(
1919
r#"
2020
import {{
21-
Context,
21+
WasmBindgenTestContext as Context,
2222
__wbgtest_console_debug,
2323
__wbgtest_console_log,
2424
__wbgtest_console_info,

crates/test/src/rt/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub mod node;
114114
///
115115
/// The node.js entry script instantiates a `Context` here which is used to
116116
/// drive test execution.
117-
#[wasm_bindgen]
117+
#[wasm_bindgen(js_name = WasmBindgenTestContext)]
118118
pub struct Context {
119119
state: Rc<State>,
120120
}
@@ -199,7 +199,7 @@ pub fn log(args: &fmt::Arguments) {
199199
js_console_log(&args.to_string());
200200
}
201201

202-
#[wasm_bindgen]
202+
#[wasm_bindgen(js_class = WasmBindgenTestContext)]
203203
impl Context {
204204
/// Creates a new context ready to run tests.
205205
///

0 commit comments

Comments
 (0)