From 947c6cf9795e348575fd495b46d6badd44c74af0 Mon Sep 17 00:00:00 2001 From: Daniel McCormack <52194107+demccormack@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:24:23 +1300 Subject: [PATCH] Debug Github action --- .github/workflows/frontend.yml | 8 +++++++- frontend/tests/mocks/index.ts | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index efc9332..65e09cb 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -19,8 +19,14 @@ jobs: - name: Install Node.js dependencies run: cd frontend && npm install + - name: Copy env file + run: "cp .env.development frontend/.env.test" + - name: Run tests - run: cd frontend && npx vitest --run + run: | + cd frontend + find .. -name '.env*' + npx vitest --run - name: Lint and format uses: wearerequired/lint-action@v2.3.0 diff --git a/frontend/tests/mocks/index.ts b/frontend/tests/mocks/index.ts index f455104..1c4af82 100644 --- a/frontend/tests/mocks/index.ts +++ b/frontend/tests/mocks/index.ts @@ -5,7 +5,7 @@ import Films from './Films'; import OfficeSpace from './OfficeSpace'; const handlers = [ - rest.get(import.meta.env.VITE_API_ROOT, (req, res, ctx) => { + rest.get('http://127.0.0.1:8080/', (req, res, ctx) => { const dir = req.url.searchParams.get('dir'); const data = @@ -31,7 +31,7 @@ const handlers = [ `), ); }), - rest.get(`${import.meta.env.VITE_MEDIA_ROOT}welcome`, (req, res, ctx) => { + rest.get(`http://127.0.0.1:8080/welcome`, (req, res, ctx) => { return res(ctx.status(204)); }), ];