Равенство: toBe (===), toEqual (deep), toStrictEqual (учитывает undefined). Числа: toBeGreaterThan, toBeLessThan, toBeCloseTo. Строки: toMatch (regex или substring). Массивы: toContain, toHaveLength, toContainEqual. Объекты: toHaveProperty("path.nested", value). Async: resolves.toBe, rejects.toThrow. Ошибки: toThrow("message"), toThrowError(ErrorClass). Отрицание: expect(x).not.toBe(y). Mock: toHaveBeenCalled, toHaveBeenCalledWith, toHaveBeenCalledTimes. toMatchSnapshot для snapshot тестирования.
Какие основные матчеры (matchers) есть в Jest?
Junior
356 просмотровAFK Offer AI
Как использовать zod для валидации в Node.js?