Skip to content

Commit 8d25ede

Browse files
committed
chore: add eslint plugin for jest-playwright
1 parent 1862c54 commit 8d25ede

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.eslintrc.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ extends:
1616
- plugin:import/typescript
1717
- plugin:prettier/recommended
1818
- prettier # Removes eslint rules that conflict with prettier.
19+
# Recommended by jest-playwright
20+
# https://github.com/playwright-community/jest-playwright#globals
21+
- plugin:jest-playwright/recommended
1922

2023
rules:
2124
# Sometimes you need to add args to implement a function signature even
@@ -32,7 +35,13 @@ rules:
3235
"@typescript-eslint/no-extra-semi": off
3336
eqeqeq: error
3437
import/order:
35-
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
38+
[
39+
error,
40+
{
41+
alphabetize: { order: "asc" },
42+
groups: [["builtin", "external", "internal"], "parent", "sibling"],
43+
},
44+
]
3645
no-async-promise-executor: off
3746
# This isn't a real module, just types, which apparently doesn't resolve.
3847
import/no-unresolved: [error, { ignore: ["express-serve-static-core"] }]

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"eslint-config-prettier": "^8.1.0",
6060
"eslint-import-resolver-alias": "^1.1.2",
6161
"eslint-plugin-import": "^2.18.2",
62+
"eslint-plugin-jest-playwright": "^0.2.1",
6263
"eslint-plugin-prettier": "^3.1.0",
6364
"istanbul-badges-readme": "^1.2.0",
6465
"leaked-handles": "^5.2.0",

test/jest.e2e.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ const config: Config.InitialOptions = {
77
"^.+\\.ts$": "<rootDir>/node_modules/ts-jest",
88
},
99
globalSetup: "<rootDir>/utils/globalSetup.ts",
10-
testEnvironment: "node",
10+
testEnvironmentOptions: {
11+
"jest-playwright": {
12+
// TODO enable on webkit as well
13+
// waiting on https://github.com/playwright-community/jest-playwright/issues/659
14+
browsers: ["chromium", "firefox"],
15+
},
16+
},
1117
testPathIgnorePatterns: ["/node_modules/", "/lib/", "/out/", "test/unit"],
1218
testTimeout: 30000,
1319
modulePathIgnorePatterns: [

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,6 +3133,11 @@ eslint-plugin-import@^2.18.2:
31333133
resolve "^1.17.0"
31343134
tsconfig-paths "^3.9.0"
31353135

3136+
eslint-plugin-jest-playwright@^0.2.1:
3137+
version "0.2.1"
3138+
resolved "https://registry.yarnpkg.com/eslint-plugin-jest-playwright/-/eslint-plugin-jest-playwright-0.2.1.tgz#8778fee9d5915132a03d94370d3eea0a7ddd08f3"
3139+
integrity sha512-BicKUJUpVPsLbHN8c5hYaZn6pv8PCMjBGHXUfvlY1p75fh4APVfX2gTK14HuiR8/Bv3fKBQu5MTaqCro4E3OHg==
3140+
31363141
eslint-plugin-prettier@^3.1.0:
31373142
version "3.3.1"
31383143
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz#7079cfa2497078905011e6f82e8dd8453d1371b7"

0 commit comments

Comments
 (0)