Merge pull request #1280 from alexcrichton/rename-context

Rename test `Context` in JS
This commit is contained in:
Alex Crichton 2019-02-20 11:52:51 -06:00 committed by GitHub
commit 74a39ce618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ pub fn execute(
const support = require("./{0}"); const support = require("./{0}");
const wasm = require("./{0}_bg"); const wasm = require("./{0}_bg");
cx = new support.Context(); cx = new support.WasmBindgenTestContext();
handlers.on_console_debug = support.__wbgtest_console_debug; handlers.on_console_debug = support.__wbgtest_console_debug;
handlers.on_console_log = support.__wbgtest_console_log; handlers.on_console_log = support.__wbgtest_console_log;
handlers.on_console_info = support.__wbgtest_console_info; handlers.on_console_info = support.__wbgtest_console_info;

View File

@ -18,7 +18,7 @@ pub fn spawn(
let mut js_to_execute = format!( let mut js_to_execute = format!(
r#" r#"
import {{ import {{
Context, WasmBindgenTestContext as Context,
__wbgtest_console_debug, __wbgtest_console_debug,
__wbgtest_console_log, __wbgtest_console_log,
__wbgtest_console_info, __wbgtest_console_info,

View File

@ -114,7 +114,7 @@ pub mod node;
/// ///
/// The node.js entry script instantiates a `Context` here which is used to /// The node.js entry script instantiates a `Context` here which is used to
/// drive test execution. /// drive test execution.
#[wasm_bindgen] #[wasm_bindgen(js_name = WasmBindgenTestContext)]
pub struct Context { pub struct Context {
state: Rc<State>, state: Rc<State>,
} }
@ -199,7 +199,7 @@ pub fn log(args: &fmt::Arguments) {
js_console_log(&args.to_string()); js_console_log(&args.to_string());
} }
#[wasm_bindgen] #[wasm_bindgen(js_class = WasmBindgenTestContext)]
impl Context { impl Context {
/// Creates a new context ready to run tests. /// Creates a new context ready to run tests.
/// ///