You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -111,6 +112,7 @@ pnpm test # Run all Vitest tests
111
112
pnpm test:unit # Unit tests only
112
113
pnpm test:nuxt # Nuxt component tests
113
114
pnpm test:browser # Playwright E2E tests
115
+
pnpm test:a11y # Lighthouse accessibility audits
114
116
```
115
117
116
118
### Project structure
@@ -598,6 +600,40 @@ A coverage test in `test/unit/a11y-component-coverage.spec.ts` ensures all compo
598
600
> [!IMPORTANT]
599
601
> Just because axe-core doesn't find any obvious issues, it does not mean a component is accessible. Please do additional checks and use best practices.
600
602
603
+
### Lighthouse accessibility tests
604
+
605
+
In addition to component-level axe audits, the project runs full-page accessibility audits using [Lighthouse CI](https://github.com/GoogleChrome/lighthouse-ci). These test the rendered pages in both light and dark mode against Lighthouse's accessibility category, requiring a perfect score.
606
+
607
+
#### How it works
608
+
609
+
1. The project is built in test mode (`pnpm build:test`), which activates server-side fixture mocking
610
+
2. Lighthouse CI starts a preview server and audits three URLs: `/`, `/search?q=nuxt`, and `/package/nuxt`
611
+
3. A Puppeteer setup script (`lighthouse-setup.cjs`) runs before each audit to set the color mode and intercept client-side API requests using the same fixtures as the E2E tests
This requires Chrome or Chromium to be installed. The script will auto-detect common installation paths. Results are printed to the terminal and saved in `.lighthouseci/`.
0 commit comments