From 54f3d0437535437d6e689b1c6e0ef78c9e623436 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:38:42 +0000 Subject: [PATCH 1/3] Initial plan From 8ee5b11550efbeaf7813464e067353f9d12014f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:43:55 +0000 Subject: [PATCH 2/3] Configure E2E tests to use SQLite in-memory and add to GitHub Actions Co-authored-by: buzz-code <72219643+buzz-code@users.noreply.github.com> --- .github/workflows/run-tests.yml | 1 + server/test/app.e2e-spec.ts | 14 +++++++++++++- server/test/jest-e2e.json | 3 ++- server/test/setup-e2e.ts | 3 +++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 server/test/setup-e2e.ts diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2f34f789..ff1fbaa7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -48,6 +48,7 @@ jobs: cache-dependency-path: server/yarn.lock - run: yarn - run: yarn test + - run: yarn test:e2e client-tests: diff --git a/server/test/app.e2e-spec.ts b/server/test/app.e2e-spec.ts index 65d668ce..9f5b253b 100644 --- a/server/test/app.e2e-spec.ts +++ b/server/test/app.e2e-spec.ts @@ -1,11 +1,12 @@ -process.env.JWT_SECRET = 'test-secret'; import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import * as request from 'supertest'; import { AppModule } from 'src/app.module'; +import { DataSource } from 'typeorm'; describe('AppController (e2e)', () => { let app: INestApplication; + let dataSource: DataSource; beforeEach(async () => { const moduleFixture: TestingModule = await Test.createTestingModule({ @@ -14,6 +15,12 @@ describe('AppController (e2e)', () => { app = moduleFixture.createNestApplication(); await app.init(); + + dataSource = moduleFixture.get(DataSource); + }); + + afterEach(async () => { + await app.close(); }); it('/ (GET)', () => { @@ -22,4 +29,9 @@ describe('AppController (e2e)', () => { .expect(200) .expect('Hello World!'); }); + + it('should use SQLite in-memory database for E2E tests', () => { + expect(dataSource.options.type).toBe('sqlite'); + expect((dataSource.options as any).database).toBe(':memory:'); + }); }); diff --git a/server/test/jest-e2e.json b/server/test/jest-e2e.json index 68798115..915e569a 100644 --- a/server/test/jest-e2e.json +++ b/server/test/jest-e2e.json @@ -10,5 +10,6 @@ "moduleNameMapper": { "^src/(.*)$": "/src/$1", "^@shared/(.*)$": "/shared/$1" - } + }, + "setupFiles": ["/test/setup-e2e.ts"] } diff --git a/server/test/setup-e2e.ts b/server/test/setup-e2e.ts new file mode 100644 index 00000000..8385a2f0 --- /dev/null +++ b/server/test/setup-e2e.ts @@ -0,0 +1,3 @@ +// Set environment variables for E2E tests +process.env.NODE_ENV = 'test'; +process.env.JWT_SECRET = 'test-secret'; From f7acf6ec2e5c4a61754f02fd2c0acf5a6283a22d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:45:34 +0000 Subject: [PATCH 3/3] Add assertion to verify DataSource is defined in E2E test Co-authored-by: buzz-code <72219643+buzz-code@users.noreply.github.com> --- server/test/app.e2e-spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/test/app.e2e-spec.ts b/server/test/app.e2e-spec.ts index 9f5b253b..fd834eb6 100644 --- a/server/test/app.e2e-spec.ts +++ b/server/test/app.e2e-spec.ts @@ -31,6 +31,7 @@ describe('AppController (e2e)', () => { }); it('should use SQLite in-memory database for E2E tests', () => { + expect(dataSource).toBeDefined(); expect(dataSource.options.type).toBe('sqlite'); expect((dataSource.options as any).database).toBe(':memory:'); });