Skip to content

Commit

Permalink
feat(jest): Rework jest config to account for extends support in esli…
Browse files Browse the repository at this point in the history
…nt overrides

BREAKING CHANGE: Jest config now disables global-require rule and enables jest globals for all files
when extended
  • Loading branch information
tomfin46 committed Nov 6, 2019
1 parent 07c1f7d commit 9a16709
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,13 @@ module.exports = {
'plugin:jest-formatting/recommended'
],
env: {
'jest/globals': false
'jest/globals': true
},
rules: {
// Allow padding before beforeAll and beforeEach blocks as we often declare variables there to be initialised within the block
'jest-formatting/padding-around-before-all-blocks': 'off',
'jest-formatting/padding-around-before-each-blocks': 'off'
},
overrides: [
{
files: [
'setupTests.js',
'test-setup-*.browser.js',
'**/*.spec.js',
'**/__mocks__/**',
'**/__test_helpers__/**',
'**/__tests__/**',
'**/__TESTS__/**'
],
env: {
'jest/globals': true
},
rules: {
// Allow inline require() when using doMock conventions
'global-require': 'off',
}
}
]
'jest-formatting/padding-around-before-each-blocks': 'off',
// Allow inline require() when using doMock conventions
'global-require': 'off',
}
}

0 comments on commit 9a16709

Please sign in to comment.