Jest

CLI

Run specific test

jest spec/index
jest -t testName

Matchers

Match partial objects, arrays, strings

expect(mockFn).toHaveBeenCalledWith(
    expect.objectContaining({
        id: 123,
        name: expect.stringContaining('sofa'),
        model: expect.stringMatching(/A\d{3}/),
        colors: expect.arrayContaining(['red', 'blue']),
    })
)