Skip to content

Commit c38072a

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

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
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/project.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
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": {},
1121
"unit-test": {}
1222
}

project.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
},
2727
"code-pushup-jsdocs": {},
2828
"code-pushup-typescript": {},
29-
"code-pushup-axe": {},
29+
"code-pushup-axe": {
30+
"dependsOn": ["^install-browsers"]
31+
},
3032
"code-pushup": {
3133
"dependsOn": ["code-pushup-*"],
3234
"executor": "nx:run-commands",

0 commit comments

Comments
 (0)