Skip to content

Commit 3abb124

Browse files
author
Dane Pilcher
authored
style: run eslint on test files (#767)
1 parent 3c363c6 commit 3abb124

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

.eslintrc.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,35 @@ module.exports = {
225225
'operator-assignment': 'off',
226226
'import/no-named-default': 'off',
227227
},
228+
overrides: [
229+
{
230+
// edit rules here to modify test linting
231+
files: ['__tests__/**', '*.test.ts', '*.test.js'],
232+
plugins: ['jest'],
233+
extends: ['plugin:jest/recommended'],
234+
rules: {
235+
// jest describe/test can be very long
236+
'max-lines-per-function': 'off',
237+
238+
// to be fixed and enabled later
239+
'jest/no-conditional-expect': 'warn',
240+
'jest/valid-title': 'warn',
241+
'jest/no-export': 'warn',
242+
'no-trailing-spaces': 'warn',
243+
'jest/no-standalone-expect': 'warn',
244+
'jest/no-conditional-expect': 'warn',
245+
'jest/valid-expect': 'warn',
246+
'jest/no-identical-title': 'warn',
247+
'no-useless-computed-key': 'warn',
248+
'@typescript-eslint/ban-ts-comment': 'warn',
249+
'guard-for-in': 'warn',
250+
},
251+
},
252+
],
228253
'ignorePatterns': [
229254
'node_modules',
230255
'dist',
231256
'build',
232-
'tests',
233-
'__test__',
234-
'__tests__',
235257
'__mocks__',
236258
'__e2e__',
237259
'coverage',

packages/amplify-codegen-e2e-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
},
4242
"devDependencies": {
4343
"@types/jest": "^27.0.0",
44+
"graphql": "^15.8.0",
4445
"ts-node": "^8.10.1"
4546
},
4647
"peerDependencies": {

packages/amplify-codegen-e2e-tests/src/__tests__/build-app-swift.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
initProjectWithQuickstart
2+
initProjectWithQuickstart,
33
initIosProjectWithProfile,
44
addApiWithDefaultSchemaAndConflictDetection,
55
DEFAULT_IOS_CONFIG,

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9444,7 +9444,7 @@ graphql-transformer-core@^8.0.0:
94449444
graphql-transformer-common "4.25.1"
94459445
lodash "^4.17.21"
94469446

9447-
[email protected], graphql@^15.5.0:
9447+
[email protected], graphql@^15.5.0, graphql@^15.8.0:
94489448
version "15.8.0"
94499449
resolved "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
94509450
integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==

0 commit comments

Comments
 (0)