[Jest] Setup and Teardown

Featured image for [Jest] Setup and Teardown

0. 참고자료 Setup and Teardown · Jest Often while writing tests you have some setup work that needs to happen before tests run, and you have some finishing work that needs to happen after tests run. Jest provides helper functions to handle this. 1. 설정 및 해제 테스트를 작성하는 동안에는 테스트가 실행되기 전에 수행해야 하는 … 더 읽기

[Jest] Matcher

1. Matcher? Using Matchers · Jest Jest uses “matchers” to let you test values in different ways. This document will introduce some commonly used matchers. For the full list, see the expect API doc. matcher란 입력을 해석하고 기댓값과 일치하는지 (혹은 일치하지 않는지) 판별할 때 주로 사용된다. 여기서 .toBe가 matcher에 해당한다. 2. toBe & toEqual 지금을 … 더 읽기

[Jest] node.js 테스트 프레임워크

Featured image for [Jest] node.js 테스트 프레임워크

1. node.js 테스트 프레임워크 Node.js에서 가장 많이 사용되는 테스트 프레임워크는 Jest와 Mocha입니다. 다음은 많이 사용되는 순서대로 소개하겠습니다. 2. Jest vs Mocha 다음은 Jest와 Mocha의 유저 수를 비교한 표입니다. 두 프레임워크 모두 우수한 기능과 성능을 제공하며, 개발자들 사이에서 많은 인기를 얻고 있습니다. 프로젝트의 특성과 개발자의 선호도를 고려해서 선택합니다. 다음은 Mocha와 Jest의 장단점을 비교한 표입니다. Mocha와 Jest … 더 읽기