Skip to content

Commit b776805

Browse files
test(e2e): add Playwright linting and handle detected issue
1 parent cbc02a4 commit b776805

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {flatConfigs as importX} from "eslint-plugin-import-x";
44
import js from "@eslint/js";
55
import jsdocPlugin from "eslint-plugin-jsdoc";
66
import packageJson from "eslint-plugin-package-json";
7+
import playwright from "eslint-plugin-playwright";
78
import stylistic from "@stylistic/eslint-plugin";
89
import vitest from "eslint-plugin-vitest";
910

@@ -139,5 +140,12 @@ export default defineConfig([
139140
rules: {
140141
"@stylistic/quotes": "off"
141142
}
143+
},
144+
{
145+
files: ["tests/e2e/**/*.js"],
146+
extends: [playwright.configs["flat/recommended"]],
147+
rules: {
148+
"playwright/no-standalone-expect": "off"
149+
}
142150
}
143151
]);

package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"eslint-plugin-import-x": "^4.16.1",
107107
"eslint-plugin-jsdoc": "^61.1.11",
108108
"eslint-plugin-package-json": "^0.59.1",
109+
"eslint-plugin-playwright": "^2.3.0",
109110
"eslint-plugin-vitest": "^0.5.4",
110111
"express-basic-auth": "^1.2.1",
111112
"husky": "^9.1.7",

tests/e2e/env_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ describe("App environment", () => {
2424
});
2525

2626
it("should show the title MagicMirror²", async () => {
27-
const title = await page.locator("title").textContent();
28-
expect(title).toBe("MagicMirror²");
27+
await expect(page).toHaveTitle("MagicMirror²");
2928
});
3029
});

0 commit comments

Comments
 (0)