-
[오답] Jest로 Axios 테스트 시 Cannot use import statement outside a moduleNestJs 2023. 3. 13. 20:19
NestJs 프로젝트에서 Axios 라이브러리 설치하고 Jest 테스트를 돌리면 아래와 같이 오류가 발생 합니다.
SyntaxError: Cannot use import statement outside a module
at Runtime.createScriptFromCode (../node_modules/jest-runtime/build/index.js:1728:14)
at Object.<anonymous> (../node_modules/@nestjs/axios/dist/http.module.js:25:33)해결방법
jest 버전 업 : 29.2 이상
ts-jest 버전 업: 29.0.5 이상
'NestJs' 카테고리의 다른 글
NestJs(Node) 환경에서 TossPayments Seller 코드 예제 (0) 2024.12.17 [이슈] 토스 페이먼츠 중복 결제 (1) 2024.10.30 TypeOrm 0.2 - Relations 성능 이슈 (0) 2023.02.24 Serverless + NestJS + MikroORM 조합 시 문제 (0) 2022.03.06 [공부] NestJS (0) 2021.12.20