Skip to content

chore(test): run unit tests with vitest and add playwright e2e tests - #108

Open
brandyscarney wants to merge 3 commits into
chore/fix-lint-warningsfrom
chore/add-test-infrastructure
Open

brandyscarney wants to merge 3 commits into
chore/fix-lint-warningsfrom
chore/add-test-infrastructure

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What This Does

Moves the unit tests from Karma and Jasmine to Vitest, adds Playwright end-to-end tests, and runs both in CI.

New Behavior

  • npm run test:unit runs the unit tests once (Vitest, through Angular's @angular/build:unit-test builder). npm run test:unit:watch reruns them on changes.
  • npm run test:e2e runs the Playwright tests in Mobile Chrome (Pixel 7). It starts the dev server on port 4311, a port reserved for this app's e2e tests so it never reuses another app's server. The first time, install the browser with npx playwright install chromium.
  • npm test runs both.
  • Every pull request also runs an E2E job on Linux, which uploads the Playwright HTML report.

Changes

  • Playwright config and a smoke spec in e2e/: the first tab loads, and the tab bar opens the photo gallery.
  • Unit tests run on Vitest through @angular/build:unit-test. The 7 existing specs needed no changes (Angular's refactor-jasmine-vitest schematic found nothing to convert).
  • Removes Karma, Jasmine, and their config.
  • vitest.config.mts turns off Vitest's file-system module cache (see Notes).
  • Renovate keeps Vitest below 6 until @angular/build supports it.
  • CI: the Test job runs npm run test:unit, and the new E2E job runs npm run test:e2e.
  • renovate.json: the testing group covers Vitest, jsdom, and Playwright.
  • A Testing section in the README.

Notes

  • This PR sets up the test tooling with smoke tests; tests for the photo gallery itself come in the next PR.
  • Vitest's file-system module cache is off because, with Angular's unit-test builder, it could serve a stale build after a non-spec file changed, so local reruns could pass against old code. CI wasn't affected. The config is .mts because the package is CommonJS.

@brandyscarney
brandyscarney added this pull request to stack #107 October 23, 2026 17:09
@brandyscarney
brandyscarney requested a review from a team as a code owner October 23, 2026 17:09
@brandyscarney
brandyscarney requested review from thetaPC and removed request for a team October 23, 2026 17:09
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tutorial-photo-gallery-angular Ready Ready Preview Oct 23, 2026 7:16pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 8a3b2140 Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant