3. Jest
Jest ์์ ์ฌ์ฉํ ์ ์๋ matchers(์ผ์น์) ํ์ต
tobe
test('two plus two is four', () => {
expect(2 + 2).toBe(4);
});toEqual
test('object assignment', () => {
const data1 = { one: 1 };
expect(data1).toEqual({ one: 1 });
const data2 = { one: 123 };
expect(data2).toEqual({ one: 123 }); // ํต๊ณผ๊ฐ ๋๋ค.
expect(data2).toStrictEqual({ one: '123' }); // ํต๊ณผ๊ฐ ๋์ง ์๋๋ค.
});Truthiness ๊ฒ์ฆ
Numbers ๊ฒ์ฆ
String ๊ฐ ๊ฒ์ฆ
Arrays and iterables
Exceptions
๋น๋๊ธฐ ํ
์คํธ
Last updated