Open Collective
Open Collective
Loading
Sinon 7.2.0 and Referee 3.0.0 released
Published on December 10, 2018 by Maximilian Antoni

With the latest releases, the Sinon matchers are now shared through @sinonjs/samsam and can be used in @sinonjs/referee as well. Matchers allow you to be more fuzzy about the expected value.

const { assert, match } = require("@sinonjs/referee");

it("passes", () => {
    const object = { foo: 1, bar: "test" };

    assert.equals(object, {
        foo: 1,
        bar: match.string
    });
});

You can also write your own matchers for even more expressive assertions. Read the matcher API to learn more.