Skip to main content

ExpectValue

Struct ExpectValue 

Source
pub struct ExpectValue { /* private fields */ }

Implementations§

Source§

impl ExpectValue

Source

pub fn not(self) -> ExpectValue

Source

pub fn soft(self) -> ExpectValue

Source

pub fn with_message(self, message: impl Into<String>) -> ExpectValue

Source

pub fn is_soft(&self) -> bool

Source

pub fn actual(&self) -> &Value

Source

pub fn to_be(&self, expected: &Value) -> Result<(), AssertionFailure>

toBe(expected) — strict-equality of primitives. Object/array values are rejected with guidance to use toEqual.

Source

pub fn to_equal(&self, expected: &Value) -> Result<(), AssertionFailure>

toEqual(expected) — recursive equality. Honours asymmetric matchers embedded in expected.

Source

pub fn to_strict_equal(&self, expected: &Value) -> Result<(), AssertionFailure>

toStrictEqual(expected) — alias of Self::to_equal for serde_json::Value (no undefined to differentiate).

Source

pub fn to_be_null(&self) -> Result<(), AssertionFailure>

Source

pub fn to_be_undefined(&self) -> Result<(), AssertionFailure>

toBeUndefined is satisfied by null because serde_json cannot distinguish — the QuickJS binding emits both as Value::Null.

Source

pub fn to_be_defined(&self) -> Result<(), AssertionFailure>

Source

pub fn to_be_truthy(&self) -> Result<(), AssertionFailure>

Source

pub fn to_be_falsy(&self) -> Result<(), AssertionFailure>

Source

pub fn to_be_nan(&self) -> Result<(), AssertionFailure>

Source

pub fn to_be_close_to( &self, expected: f64, digits: Option<u8>, ) -> Result<(), AssertionFailure>

Source

pub fn to_be_greater_than(&self, expected: f64) -> Result<(), AssertionFailure>

Source

pub fn to_be_greater_than_or_equal( &self, expected: f64, ) -> Result<(), AssertionFailure>

Source

pub fn to_be_less_than(&self, expected: f64) -> Result<(), AssertionFailure>

Source

pub fn to_be_less_than_or_equal( &self, expected: f64, ) -> Result<(), AssertionFailure>

Source

pub fn to_contain(&self, expected: &Value) -> Result<(), AssertionFailure>

toContain — primitive membership in array, substring in string.

Source

pub fn to_contain_equal(&self, expected: &Value) -> Result<(), AssertionFailure>

Deep toContain — every element compared by deep_equal.

Source

pub fn to_have_length(&self, expected: usize) -> Result<(), AssertionFailure>

Source

pub fn to_have_property( &self, path: &Value, expected: Option<&Value>, ) -> Result<(), AssertionFailure>

toHaveProperty(path, value?)path may be "a.b.c" or a JSON array of keys / indexes.

Source

pub fn to_match(&self, pattern: &StringOrRegex) -> Result<(), AssertionFailure>

Jest’s toMatch(string) is substring containment; toMatch(/re/) is regex. Differs from StringOrRegex::matches (which is exact-equality for the string variant).

Source

pub fn to_match_object(&self, subset: &Value) -> Result<(), AssertionFailure>

Source

pub fn to_be_instance_of( &self, ctor_name: &str, actual_ctor_name: Option<&str>, ) -> Result<(), AssertionFailure>

toBeInstanceOf(ctorName) — checked against the binding-supplied constructor name (Class.name). When actual_ctor_name is None, falls back to the inferred built-in (e.g. Array for an array value).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,