Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- 정렬
- GIT
- dfs
- MongoDB
- game
- react
- nodejs
- Express
- Nest.js
- nestjs
- Queue
- JavaScript
- Bull
- AWS
- typeORM
- 공룡게임
- MySQL
- TypeScript
- cookie
- mongoose
- jest
- OCR
- 자료구조
- flask
- Dinosaur
- Python
- class
- 게임
- Sequelize
Archives
- Today
- Total
포시코딩
[Test] 외부 라이브러리 mock 시키기 본문
728x90
import * as jwt from 'jsonwebtoken';
jest.mock('jsonwebtoken', () => {
return { sign: jest.fn(() => 'TOKEN') };
});
요렇게 간단히 가능
728x90
'Node.js' 카테고리의 다른 글
| [NestJS] SAML Assertion에 값 추가 (passport-saml, strategy) (0) | 2024.02.05 |
|---|---|
| [NestJS] Strategy, Guard 한 파일에 깔끔하게쓰기 (1) | 2024.01.30 |
| [GraphQL] Utility type in entity (0) | 2023.12.21 |
| [TypeORM] save, insert, update, upsert 동작 원리 (0) | 2023.12.21 |
| [TypeORM] update 후 결과 리턴받기 메모용 (0) | 2023.12.21 |