Skip to content

gaslamp


Class: Expect

Creates assertion chains for testing values.

Since

0.22.0

Example

JavaScript
const expect = new gaslamp.JestLite.Expect().expect;
expect(1 + 1).toBe(2);
expect([1, 2]).toContain(2);
expect(() => { throw new Error("fail"); }).toThrow();

Constructors

Constructor

new Expect(): Expect

Returns

Expect

Methods

expect()

expect(value): Matcher

Start an assertion chain.

Parameters

value

unknown

Value to test.

Returns

Matcher

A Matcher for chaining assertion methods.