Skip to content

Commit

Permalink
chore(lint): ensure no mock APIs are used in the e2e tests (#13380)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas authored Oct 4, 2022
1 parent 3904eb8 commit 86a810d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ module.exports = {
},
},

{
files: ['e2e/__tests__/*'],
rules: {
'jest/no-restricted-jest-methods': [
'error',
{
fn: 'Please use fixtures instead of mocks in the end-to-end tests.',
mock: 'Please use fixtures instead of mocks in the end-to-end tests.',
doMock:
'Please use fixtures instead of mocks in the end-to-end tests.',
setMock:
'Please use fixtures instead of mocks in the end-to-end tests.',
spyOn:
'Please use fixtures instead of mocks in the end-to-end tests.',
},
],
},
},

// to make it more suitable for running on code examples in docs/ folder
{
files: ['**/*.md/**'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"eslint-import-resolver-typescript": "^3.2.5",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jest": "^26.1.0",
"eslint-plugin-jest": "^27.1.0",
"eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-local": "^1.0.0",
"eslint-plugin-markdown": "^3.0.0",
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ __metadata:
eslint-import-resolver-typescript: ^3.2.5
eslint-plugin-eslint-comments: ^3.1.2
eslint-plugin-import: ^2.6.0
eslint-plugin-jest: ^26.1.0
eslint-plugin-jest: ^27.1.0
eslint-plugin-jsdoc: ^39.3.6
eslint-plugin-local: ^1.0.0
eslint-plugin-markdown: ^3.0.0
Expand Down Expand Up @@ -9105,20 +9105,20 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-jest@npm:^26.1.0":
version: 26.9.0
resolution: "eslint-plugin-jest@npm:26.9.0"
"eslint-plugin-jest@npm:^27.1.0":
version: 27.1.0
resolution: "eslint-plugin-jest@npm:27.1.0"
dependencies:
"@typescript-eslint/utils": ^5.10.0
peerDependencies:
"@typescript-eslint/eslint-plugin": ^5.0.0
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
eslint: ^7.0.0 || ^8.0.0
peerDependenciesMeta:
"@typescript-eslint/eslint-plugin":
optional: true
jest:
optional: true
checksum: 6d5fd5c95368f1ca2640389aeb7ce703d6202493c3ec6bdedb4eaca37233710508b0c75829e727765a16fd27029a466d34202bc7f2811c752038ccbbce224400
checksum: 288f8fb585a18b759b4782d97368da9974df42691332e2221bac508b3de8a253da489d165593f5ed588e625177462750acfe085d818f0e786fb520c907a9e360
languageName: node
linkType: hard

Expand Down

0 comments on commit 86a810d

Please sign in to comment.