Class Expectation<Subject>
Properties
Protected entity
entity: Subject
Methods
Private cmpEq
- cmpEq(expected: any, actual: any): void
-
Parameters
-
expected: any
-
actual: any
Returns void
Private cmpMatch
- cmpMatch(expected: string, actual: any): void
-
Parameters
-
expected: string
-
actual: any
Returns void
Private cmpMsg
- cmpMsg(expected: any, actual: any, fnName: string, comment?: undefined | string): string
-
Parameters
-
expected: any
-
actual: any
-
fnName: string
-
Optional comment: undefined | string
Returns string
Private fail
- fail(expected: any, actual: any, fnName: string, comment?: undefined | string): void
-
Parameters
-
expected: any
-
actual: any
-
fnName: string
-
Optional comment: undefined | string
Returns void
glom
- glom<T, P1>(prop1: P1): Expectation<A<T>[P1]>
- glom<T, P1, P2>(prop1: P1, prop2: P2): Expectation<A<A<T>[P1]>[P2]>
- glom<T, P1, P2, P3>(prop1: P1, prop2: P2, prop3: P3): Expectation<A<A<A<T>[P1]>[P2]>[P3]>
- glom(...path: string[]): Expectation<any>
-
Type parameters
-
T: Subject
-
P1: keyof A<T>
Parameters
-
Type parameters
-
T: Subject
-
P1: keyof A<T>
-
P2: keyof A<A<T>[P1]>
Parameters
Returns Expectation<A<A<T>[P1]>[P2]>
-
Type parameters
-
T: Subject
-
P1: keyof A<T>
-
P2: keyof A<A<T>[P1]>
-
P3: keyof A<A<A<T>[P1]>[P2]>
Parameters
-
prop1: P1
-
prop2: P2
-
prop3: P3
Returns Expectation<A<A<A<T>[P1]>[P2]>[P3]>
-
Parameters
invokes
- invokes<K, F, R>(key: K, ...args: any[]): Expectation<R>
-
Type parameters
Parameters
-
key: K
-
Rest ...args: any[]
its
-
Type parameters
-
T: any
-
K: keyof Subject
-
U: Subject[K]
-
R: Promise<T> & U
Parameters
-
Type parameters
Parameters
toBe
- toBe(expected: Subject): void
toMatch
- toMatch(expected: string): void
Static with
-
Type parameters
Parameters
Returns Box<T>
An Expectation asserts a claim on the subject.
// 2 + 2 == 4 cyr.expect(2+2).toBe(4) // 'hello world' matches /hello/ cyr.expect("hello world").toMatch("hello")