Writing Tests for Custom Matchers in Jest
TLDR: Here's an example of how to write a test for a custom matcher: describe("toHaveDevDependency", () => { it("fails when given a number", () => { expect(() => { expect(2).toHaveDevDependency("node"); }).toThrow("Expected 2 to be a ...
Jul 7, 20224 min read138