From d36629d5f0a49be71c70c0fa1be291a0b1d578cb Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Tue, 12 May 2026 22:09:57 +0200 Subject: [PATCH] fix(ci): run only server tests in Docker tester stage Playwright Chromium is not available in node:24-alpine, causing the vitest 'client' project (browser tests) to fail with an unhandled browserType.launch error and exit code 1. - Dockerfile: switch tester stage command to 'npm run test:unit -- --run --project=server' so only Node.js unit tests run during Docker builds - page.svelte.spec.ts: update stale 'renders h1' assertion to match the new InstaChef design (no h1; check for 'InstaChef' logo text) Browser component tests still run locally when Playwright/Chromium is available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Dockerfile | 4 +++- src/routes/page.svelte.spec.ts | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a585258..496b0fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,9 @@ WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . -RUN npm test +# Run only server-side unit tests; browser (Playwright) tests require a full +# Chromium environment that is not available in the Alpine build stage. +RUN npm run test:unit -- --run --project=server # ── stage: builder ─────────────────────────────────────────────────────────── FROM node:24-alpine AS builder diff --git a/src/routes/page.svelte.spec.ts b/src/routes/page.svelte.spec.ts index d54f00a..fd5b03a 100644 --- a/src/routes/page.svelte.spec.ts +++ b/src/routes/page.svelte.spec.ts @@ -4,10 +4,11 @@ import { render } from 'vitest-browser-svelte'; import Page from './+page.svelte'; describe('/+page.svelte', () => { - it('should render h1', async () => { + it('should render the InstaChef app shell', async () => { render(Page); - const heading = page.getByRole('heading', { level: 1 }); - await expect.element(heading).toBeInTheDocument(); + // The app logo text is the primary visible brand element in the TopBar + const logo = page.getByText('InstaChef'); + await expect.element(logo).toBeInTheDocument(); }); });