Skip to content

Commit 5dcf3ad

Browse files
committed
feat(plugin-axe): add cacheable browser installation
1 parent 2acf72a commit 5dcf3ad

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

e2e/plugin-axe-e2e/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"lint": {},
88
"e2e": {
99
"executor": "@nx/vite:test",
10+
"dependsOn": ["^install-browsers"],
1011
"options": {
1112
"configFile": "{projectRoot}/vitest.e2e.config.ts"
1213
}

e2e/plugin-axe-e2e/tests/collect.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function sanitizeReportPaths(report: Report): Report {
1818
/file:\/{3}.+?\/index\.html/g,
1919
'file:///<TEST_DIR>/index.html',
2020
);
21-
return JSON.parse(sanitized) as Report;
21+
return JSON.parse(sanitized);
2222
}
2323

2424
describe('PLUGIN collect report with axe-plugin NPM package', () => {

packages/plugin-axe/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
"access": "public"
4141
},
4242
"type": "module",
43-
"scripts": {
44-
"postinstall": "playwright-core install chromium --with-deps || playwright-core install chromium"
45-
},
4643
"dependencies": {
4744
"@axe-core/playwright": "^4.11.0",
4845
"@code-pushup/models": "0.85.0",

packages/plugin-axe/project.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@
66
"tags": ["scope:plugin", "type:feature", "publishable"],
77
"// targets": "to see all targets run: nx show project plugin-axe --web",
88
"targets": {
9-
"build": {},
9+
"install-browsers": {
10+
"command": "playwright-core install chromium",
11+
"cache": true,
12+
"inputs": [
13+
"sharedGlobals",
14+
{ "runtime": "playwright-core install chromium --dry-run" }
15+
]
16+
},
17+
"build": {
18+
"dependsOn": ["^build", "install-browsers"]
19+
},
1020
"lint": {},
11-
"unit-test": {}
21+
"unit-test": {
22+
"dependsOn": ["install-browsers"]
23+
}
1224
}
1325
}

0 commit comments

Comments
 (0)