Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lint): ensure no mock APIs are used in the e2e tests #13380

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,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