Skip to content

Commit

Permalink
Improves RTL configuration (#13079)
Browse files Browse the repository at this point in the history
- Adds plugin:jest-dom/recommended to ESLint plugins list to enforce tests best practices

- Moves import @testing-library/jest-dom/extend-expect; from setup.ts to testing-library.tsx to avoid matchers collision

- Adds @testing-library/user-event to help simulate users events
  • Loading branch information
michael-s-molina committed Feb 11, 2021
1 parent 870886c commit 86807e4
Show file tree
Hide file tree
Showing 8 changed files with 56,150 additions and 1,036 deletions.
13 changes: 11 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,20 @@ module.exports = {
'src/**/*.test.js',
'src/**/*.test.jsx',
],
plugins: ['jest', 'jest-dom', 'no-only-tests'],
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
env: {
'jest/globals': true,
},
extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],
settings: {
jest: {
version: 'detect',
},
},
extends: [
'plugin:jest/recommended',
'plugin:jest-dom/recommended',
'plugin:testing-library/react',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
Expand Down
Loading

0 comments on commit 86807e4

Please sign in to comment.