[−][src]Struct wasm_bindgen_test::__rt::Context
Runtime test harness support instantiated in JS.
The node.js entry script instantiates a Context
here which is used to
drive test execution.
Methods
impl Context
[src]
pub fn new() -> Context
[src]
Creates a new context ready to run tests.
A Context
is the main structure through which test execution is
coordinated, and this will collect output and results for all executed
tests.
pub fn args(&mut self, args: Vec<JsValue>)
[src]
Inform this context about runtime arguments passed to the test harness.
Eventually this will be used to support flags, but for now it's just used to support test filters.
pub fn run(&self, tests: Vec<JsValue>) -> Promise
[src]
Executes a list of tests, returning a promise representing their eventual completion.
This is the main entry point for executing tests. All the tests passed
in are the JS Function
object that was plucked off the
WebAssembly.Instance
exports list.
The promise returned resolves to either true
if all tests passed or
false
if at least one test failed.
impl Context
[src]
pub fn execute_sync(&self, name: &str, f: impl FnOnce() + 'static)
[src]
Entry point for a synchronous test in wasm. The #[wasm_bindgen_test]
macro generates invocations of this method.
pub fn execute_async<F>(&self, name: &str, f: impl FnOnce() -> F + 'static) where
F: Future<Item = (), Error = JsValue> + 'static,
[src]
F: Future<Item = (), Error = JsValue> + 'static,
Entry point for an asynchronous in wasm. The
#[wasm_bindgen_test(async)]
macro generates invocations of this
method.
Trait Implementations
impl From<Context> for JsValue
[src]
impl RefFromWasmAbi for Context
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, Context>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl WasmDescribe for Context
[src]
impl IntoWasmAbi for Context
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
impl FromWasmAbi for Context
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: u32) -> Self
[src]
impl OptionFromWasmAbi for Context
[src]
impl OptionIntoWasmAbi for Context
[src]
impl RefMutFromWasmAbi for Context
[src]
Auto Trait Implementations
impl Unpin for Context
impl !Send for Context
impl !Sync for Context
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi