일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- jest
- 주간 회고
- Reconsiliation
- 인프런 멘토링
- 가상돔
- aws s3
- TDD
- virtual DOM
- F-Lab 회고
- context api
- F-Lab
- 패스트캠퍼스
- github actions
- 모노레포
- 전역 상태 관리
- Husky
- 프론트엔드
- 데이터 타입
- javascript
- 패캠
- Prettier
- Frontend
- ESLint
- Jest Matchers
- 에프랩
- 마이크로프론트엔드
- CICD
- 비동기 테스트
- F-Lab 오티
- React
- Today
- Total
목록TDD (4)
bytrustu tech blog
Jest Mock에 대해 알아보자 https://jestjs.io/docs/mock-functions Mock Functions · Jest Mock functions allow you to test the links between code by erasing the actual implementation of a function, capturing calls to the function (and the parameters passed in those calls), capturing instances of constructor functions when instantiated with new, jestjs.io Mock Functions 실제 구현 된 함수를 Mock 함수로 대체하면 코드 간의 상호 작용..
비동기 함수를 테스트해보자. https://jestjs.io/docs/asynchronous Testing Asynchronous Code · Jest It's common in JavaScript for code to run asynchronously. When you have code that runs asynchronously, Jest needs to know when the code it is testing has completed, before it can move on to another test. Jest has several ways to handle this. jestjs.io async.js fetchProduct 함수의 매개변수가 error의 경우 Error를 발생합니다. const..
Jest Matchers 사용법에 대해 알아보자. https://jestjs.io/docs/using-matchers 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. jestjs.io Common Matchers toBe: 사용하는 코드가 정확하게 값을 체크한다. loop 중 내용도 모두 체크 가능하다. test('2+2 의 결과는 4이다.', () => { expect(2 + 2).toBe(4); }); test('Arra..
Jest 초기 설정과 간단한 사용법에 대해 알아보자. 공식문서: https://jestjs.io/ 01. 환경설정 npm Jest를 설치하기 이전에 외부 라이브러리를 설치하고 관리하기 위해 npm이 필요하다. 프로젝트를 다른 개발자들도 동일한 개발환경 제공을 위해 dev추가도 하였다. npm init --y npm install jest --global npm install jest --save-dev npm install @types/jest Jest 초기 설정 jest --init Jest 초기 설정을 진행하면 Jest를 사용할 수 있도록 jest.config.js 파일이 생성된 것을 확인할 수 있다. 여기까지 진행 되었다면 이 프로젝트는 Jest를 사용할 준비가 되었다. 🎉 02. 테스트 테스트 작..