Skip to content

Commit 30c7251

Browse files
matyasfclaude
andcommitted
test: run part of the component test suite in vitest browser mode
Add a `browser` Vitest project that runs real-browser component tests via Playwright, alongside the existing jsdom `web` and `node` projects. - migrate the emotion, ui-a11y-content, ui-a11y-utils, ui-alerts, ui-avatar, ui-badge and ui-dialog test suites to browser mode, and delete the Cypress specs they replace - alias `@instructure/*` workspace packages to TypeScript source so browser tests run without a prebuild, and alias bare `moment` to the all-locales build - exclude the migrated packages from the `web` project so they do not run twice - add `test:browser`, `test:browser-watch` and `test:browser-ui` scripts - add a `Vitest browser tests` job to PR validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b99dd57 commit 30c7251

31 files changed

Lines changed: 1316 additions & 1335 deletions

.github/workflows/pr-validation.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ jobs:
3737
run: pnpm run bootstrap
3838
- name: Run vitest unit tests
3939
run: pnpm run test:vitest
40+
vitest-browser-tests:
41+
name: Vitest browser tests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v6
45+
- uses: pnpm/action-setup@v6
46+
- uses: actions/setup-node@v6
47+
with:
48+
node-version: '24'
49+
cache: 'pnpm'
50+
- name: Install dependencies
51+
run: pnpm install --frozen-lockfile
52+
- name: Install Playwright browser
53+
run: pnpm exec playwright install --with-deps chromium
54+
- name: Bootstrap project
55+
run: pnpm run bootstrap
56+
- name: Run vitest browser tests
57+
run: pnpm run test:browser
4058
cypress:
4159
name: Cypress component tests
4260
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ __build__
1515
.tmp/
1616
.pnpm-store/
1717
.transpile-diff/
18+
.vitest-attachments/
1819

1920
tsconfig.build.tsbuildinfo
2021
tsconfig.node.build.tsbuildinfo

cypress/component/Dialog.cy.tsx

Lines changed: 0 additions & 157 deletions
This file was deleted.

cypress/component/Emotion-useStyle.cy.tsx

Lines changed: 0 additions & 161 deletions
This file was deleted.

0 commit comments

Comments
 (0)