Jest

ํ ์คํธ ํ๋ ์์ํฌ Jest ๋ฉ์๋ ์ ๋ฆฌ
toBe const fn = { add: (num1, num2) => num1 + num2, } module.exports = fn; const fn = require('./fn'); test('์ฒซ๋ฒ์งธ ํ ์คํธ์ ๋๋ค!', () => { expect(1).toBe(1); }); test('์ด๊ฒ์ ํ์ดํ๋ค', () => { expect('ํ์ดํ').toBe('ํ์ดํ'); }); //์ฑ๊ณต ์ผ์ด์ค test('fn.add(2,3) = 5', () => { expect(fn.add(2, 3)).toBe(5); }); //์คํจ ์ผ์ด์ค test('fn.add(2,3) =! 7', () => { expect(fn.add(2, 3)).toBe(7); }); toEqual๊ณผ toS..