Jest Assertion Matchers
[Jest] Assertion Matchers 활용
[Jest] Assertion Matchers 활용
2022.01.17🎯 Assertion Matchers 활용 toBe() : 객체의 내용을 비교 toEqual() : 객체 자체를 비교할 toContain() toMatch() toThrow() function isPythagorean(a, b, c) { return a * a + b * b === c * c } function createTodo(id, title, content) { return { id, title, content } } function transformUser(user) { const { name, age, address } = user return [name, age, address] } 📝 toBe() test('Should 3, 4, 5 pythagorean', () => { expect(is..