[−][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.
Implementations
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<Output = ()> + 'static, [src]
F: Future<Output = ()> + '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 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 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 OptionFromWasmAbi for Context[src]
impl OptionIntoWasmAbi for Context[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 RefMutFromWasmAbi for Context[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, Context>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor[src]
impl WasmDescribe for Context[src]
Auto Trait Implementations
impl !RefUnwindSafe for Context[src]
impl !Send for Context[src]
impl !Sync for Context[src]
impl Unpin for Context[src]
impl !UnwindSafe for Context[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi, [src]
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
pub fn return_abi(self) -> <T as ReturnWasmAbi>::Abi[src]
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.
pub 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>,