mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Merge pull request #1280 from alexcrichton/rename-context
Rename test `Context` in JS
This commit is contained in:
commit
74a39ce618
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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>,
|
||||
}
|
||||
@ -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.
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user