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 | 29 | 30 |
| 31 |
Tags
- import
- animation
- package
- 파이썬
- 클래스
- 플러터
- 콜렉션
- set
- 크롤러
- Collection
- 코틀린
- List
- text
- pushnamed
- kotlin
- ML
- 함수
- function
- textstyle
- crawler
- python
- Android
- variable
- 웹크롤러
- map
- Class
- Flutter
- rust
- 다트
- DART
Archives
- Today
- Total
조용한 담장
Jest Error: import statement outside a module 본문
Jest 의 에러
Jest encountered an unexpected token
SyntaxError: Cannot use import statement outside a module
를 해결 한 방법.
아래의 패키지 설치 (npm install)
- @babel/core
- @babel/preset-env
- @babel/plugin-transform-modules-commonjs
- @babel/plugin-transform-runtime
project root directory 에 babel.config.js 파일 생성
module.exports = {
presets: ["@babel/preset-env"],
env: {
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-runtime'
]
}
}
}
해결!
'tips' 카테고리의 다른 글
| Markdown 에 diagram 을 넣자. (0) | 2022.02.21 |
|---|---|
| [python] __import__, importlib.import_module (0) | 2021.08.17 |
| 간단한 내부 테스트용 HTTP server (0) | 2020.08.11 |
| Debian 10 buster 에서 samba, 윈도우즈 공유 (0) | 2020.03.12 |
| docker commit (0) | 2020.02.10 |
Comments