Skip to content

Commit

Permalink
chore: update recommended config
Browse files Browse the repository at this point in the history
BREAKING CHANGE: new rules added to recommended config

closes #429
  • Loading branch information
SimenB committed Oct 27, 2019
1 parent ce4260d commit aace615
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -111,28 +111,28 @@ installations requiring long-term consistency.
| Rule | Description | Configurations | Fixable |
| ------------------------------ | ----------------------------------------------------------------- | ---------------- | ------------------- |
| [consistent-test-it][] | Enforce consistent test or it keyword | | ![fixable-green][] |
| [expect-expect][] | Enforce assertion to be made in a test body | | |
| [expect-expect][] | Enforce assertion to be made in a test body | ![recommended][] | |
| [lowercase-name][] | Disallow capitalized test names | | ![fixable-green][] |
| [no-alias-methods][] | Disallow alias methods | ![recommended][] | ![fixable-green][] |
| [no-commented-out-tests][] | Disallow commented out tests | | |
| [no-alias-methods][] | Disallow alias methods | ![style][] | ![fixable-green][] |
| [no-commented-out-tests][] | Disallow commented out tests | ![recommended][] | |
| [no-disabled-tests][] | Disallow disabled tests | ![recommended][] | |
| [no-duplicate-hooks][] | Disallow duplicate hooks within a `describe` block | | |
| [no-expect-resolves][] | Disallow using `expect().resolves` | | |
| [no-export][] | Disallow export from test files | | |
| [no-export][] | Disallow export from test files | ![recommended][] | |
| [no-focused-tests][] | Disallow focused tests | ![recommended][] | |
| [no-hooks][] | Disallow setup and teardown hooks | | |
| [no-identical-title][] | Disallow identical titles | ![recommended][] | |
| [no-if][] | Disallow conditional logic | | |
| [no-jasmine-globals][] | Disallow Jasmine globals | ![recommended][] | ![fixable-yellow][] |
| [no-jest-import][] | Disallow importing `jest` | ![recommended][] | |
| [no-large-snapshots][] | Disallow large snapshots | | |
| [no-mocks-import][] | Disallow manually importing from `__mocks__` | | |
| [no-mocks-import][] | Disallow manually importing from `__mocks__` | ![recommended][] | |
| [no-standalone-expect][] | Prevents `expect` statements outside of a `test` or `it` block | | |
| [no-test-callback][] | Using a callback in asynchronous tests | | ![fixable-green][] |
| [no-test-callback][] | Using a callback in asynchronous tests | ![recommended][] | ![fixable-green][] |
| [no-test-prefixes][] | Disallow using `f` & `x` prefixes to define focused/skipped tests | ![recommended][] | ![fixable-green][] |
| [no-test-return-statement][] | Disallow explicitly returning from tests | | |
| [no-truthy-falsy][] | Disallow using `toBeTruthy()` & `toBeFalsy()` | | |
| [no-try-expect][] | Prevent `catch` assertions in tests | | |
| [no-try-expect][] | Prevent `catch` assertions in tests | ![recommended][] | |
| [prefer-called-with][] | Suggest using `toBeCalledWith()` OR `toHaveBeenCalledWith()` | | |
| [prefer-expect-assertions][] | Suggest using `expect.assertions()` OR `expect.hasAssertions()` | | |
| [prefer-hooks-on-top][] | Suggest to have all hooks at top-level before tests | | |
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Expand Up @@ -44,14 +44,18 @@ export = {
'jest/globals': true,
},
rules: {
'jest/no-alias-methods': 'warn',
'jest/expect-expect': 'warn',
'jest/no-commented-out-tests': 'warn',
'jest/no-disabled-tests': 'warn',
'jest/no-export': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/no-jest-import': 'error',
// 'jest/no-mocks-import': 'error',
'jest/no-mocks-import': 'error',
'jest/no-jasmine-globals': 'warn',
'jest/no-test-callback': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-try-expect': 'error',
'jest/valid-describe': 'error',
'jest/valid-expect': 'error',
'jest/valid-expect-in-promise': 'error',
Expand All @@ -60,6 +64,7 @@ export = {
style: {
plugins: ['jest'],
rules: {
'jest/no-alias-methods': 'warn',
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-contain': 'error',
Expand Down

0 comments on commit aace615

Please sign in to comment.