분명히 며칠 전까진 잘 돌던 jest 테스트 케이스가 아래와 같은 메시지를 뱉으며 실패했다. ● Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript. By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules". Here's what you can do: • If you are trying ..
AWS lambda 노드 런타임을 사용할 때, 공통 코드를 layer(계층)에 관리하고 있다면 다음과 같이 import하여 사용하게 된다. const myLibrary = require('/opt/myLibrary'); exports.handler = function(event, context) { myLibrary.greeting(); // hello! } 그러나 해당 코드를 로컬에서 테스트하는 경우, 계층에 포함된 라이브러리가 로컬 환경의 /opt 하위 경로에 존재하지 않으므로 모듈을 임포트할 수 없는 문제가 발생한다. jest를 사용하여 테스트하는 경우, jest.config.js에 다음과 같이 작성하여 문제를 쉽게 해결할 수 있다. module.exports = { moduleNameMapper:..
- Total
- Today
- Yesterday
- RancherDesktop
- Spring Cloud Config
- Node.js
- react
- etc
- kotlin
- terraform
- Git
- Vault
- postgresql
- hashicorp
- Java
- 코딩테스트
- AWS
- eureka
- jQuery
- JPA
- javascript
- pgloader
- Puppeteer
- mysql
- Linux
- AWS IoT
- shell
- Docker
- spring boot
- IntelliJ
- Database
- Gradle
- JEST
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |