-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jest에서 Require.context is not function 이라는 에러가 발생할 경우
- Loading branch information
1 parent
25e2866
commit 5be72c9
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Jest에서 Require.context is not function 이라는 에러가 발생할 경우 | ||
|
||
# 해결 | ||
[babel-plugin-transform-require-context](https://www.npmjs.com/package/babel-plugin-transform-require-context) 플러그인을 설치한 후에 | ||
```shell | ||
npm install -dev babel-plugin-transform-require-context | ||
``` | ||
|
||
`.babelrc` 혹은 `babel.config.js` 에 플러그인을 추가해주면 된다. | ||
|
||
```json | ||
{ | ||
"env": { | ||
"test": { | ||
"plugins": ["transform-require-context"] | ||
} | ||
} | ||
} | ||
``` |