Skip to content

Commit

Permalink
Jest에서 Require.context is not function 이라는 에러가 발생할 경우
Browse files Browse the repository at this point in the history
  • Loading branch information
genie-youn committed Jan 31, 2021
1 parent 25e2866 commit 5be72c9
Showing 1 changed file with 19 additions and 0 deletions.
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"]
}
}
}
```

0 comments on commit 5be72c9

Please sign in to comment.