Skip to content

Commit

Permalink
Merge pull request #1280 from alexcrichton/rename-context
Browse files Browse the repository at this point in the history
Rename test `Context` in JS
  • Loading branch information
alexcrichton committed Feb 20, 2019
2 parents de85d99 + 7fbe021 commit 74a39ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/cli/src/bin/wasm-bindgen-test-runner/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn execute(
const support = require("./{0}");
const wasm = require("./{0}_bg");
cx = new support.Context();
cx = new support.WasmBindgenTestContext();
handlers.on_console_debug = support.__wbgtest_console_debug;
handlers.on_console_log = support.__wbgtest_console_log;
handlers.on_console_info = support.__wbgtest_console_info;
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/bin/wasm-bindgen-test-runner/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn spawn(
let mut js_to_execute = format!(
r#"
import {{
Context,
WasmBindgenTestContext as Context,
__wbgtest_console_debug,
__wbgtest_console_log,
__wbgtest_console_info,
Expand Down
4 changes: 2 additions & 2 deletions crates/test/src/rt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub mod node;
///
/// The node.js entry script instantiates a `Context` here which is used to
/// drive test execution.
#[wasm_bindgen]
#[wasm_bindgen(js_name = WasmBindgenTestContext)]
pub struct Context {
state: Rc<State>,
}
Expand Down Expand Up @@ -199,7 +199,7 @@ pub fn log(args: &fmt::Arguments) {
js_console_log(&args.to_string());
}

#[wasm_bindgen]
#[wasm_bindgen(js_class = WasmBindgenTestContext)]
impl Context {
/// Creates a new context ready to run tests.
///
Expand Down

0 comments on commit 74a39ce

Please sign in to comment.