Skip to content

Commit

Permalink
Add eslint-plugin-jest (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
doochik authored Apr 29, 2024
1 parent 140f8e3 commit 46a4701
Show file tree
Hide file tree
Showing 22 changed files with 442 additions and 86 deletions.
23 changes: 22 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
module.exports = {
extends: 'plugin:nop/nop',
extends: [
'plugin:nop/nop',
'eslint:recommended',
],
plugins: [
'jest',
],
env: {
jest: true,
},
rules: {
'jest/consistent-test-it': [ 'error', {
fn: 'it',
withinDescribe: 'it',
} ],
'jest/expect-expect': [ 'error', { assertFunctionNames: [ 'expect' ] } ],
'jest/no-alias-methods': 'error',
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/no-large-snapshots': [ 'error', { maxSize: 500 } ],
'jest/valid-expect': 'error',
},
};

2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ts-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ module.exports = {
'/tests/server.js',
'/tests/helpers.js',
],
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
};

Loading

0 comments on commit 46a4701

Please sign in to comment.