@jakobkg/expect
    Preparing search index...

    Function expect

    • Starts an assertion on actual.

      Which matchers are available depends on the type of actual: every value gets CommonMatchers, and strings, arrays and numbers get matchers specific to them. A failed matcher throws an AssertionError from node:assert, which test runners such as node:test report as a failure.

      Type Parameters

      • T

      Parameters

      • actual: T

      Returns Expect<T>

      expect(1 + 1).toBe(2);
      expect("hello").toHaveLength(5).and.toMatch(/^h/);
      expect([1, 2, 3]).not.toContain(4);