Skip to content

Commit

Permalink
feat: added support for jestdom plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
danielc92 committed May 18, 2023
1 parent 2e08aed commit 09202ca
Show file tree
Hide file tree
Showing 8 changed files with 1,852 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ The default configuration contains rules for

#### Using the React add on

If you wish to use the React configuration, which includes react hooks and React rules, install these additional dependencies:
If you wish to use the React configuration, which includes linting rules for react, react hooks as well as jest dom, install these additional dependencies:

```
npm i eslint-plugin-react eslint-plugin-react-hooks --save-dev
npm i eslint-plugin-jest-dom eslint-plugin-react eslint-plugin-react-hooks --save-dev
```

Next extend the eslint config
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ module.exports = {
presets: [
[ '@babel/preset-env', { targets: { node: 'current' } } ],
'@babel/preset-typescript',
'@babel/preset-react'
],
};
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
*/

module.exports = {
testEnvironment: "jsdom",
clearMocks: true,
coverageProvider: 'v8',
testPathIgnorePatterns: ['src/testing-files/jest-plugin']
testPathIgnorePatterns: ['src/testing-files'],
"transform": {
"\\.[jt]sx?$": "babel-jest"
},
};
Loading

0 comments on commit 09202ca

Please sign in to comment.