diff --git a/frontend/tests/controllers/student-controller.test.ts b/frontend/tests/controllers/student-controller.test.ts index 63516f9f..abd5985f 100644 --- a/frontend/tests/controllers/student-controller.test.ts +++ b/frontend/tests/controllers/student-controller.test.ts @@ -1,7 +1,7 @@ -import { StudentController } from '../../src/controllers/students'; -import { expect, it } from 'vitest'; +import { StudentController } from "../../src/controllers/students"; +import { expect, it } from "vitest"; -it('Get students', async () => { +it("Get students", async () => { const controller = new StudentController(); const data = await controller.getAll(true); expect(data.students).to.have.length.greaterThan(0); diff --git a/frontend/tests/setup-backend.ts b/frontend/tests/setup-backend.ts index 9c5d5d05..cd9f2e96 100644 --- a/frontend/tests/setup-backend.ts +++ b/frontend/tests/setup-backend.ts @@ -1,5 +1,5 @@ -import { spawn } from 'child_process'; -import { ChildProcess } from 'node:child_process'; +import { spawn } from "child_process"; +import { ChildProcess } from "node:child_process"; let backendProcess: ChildProcess; @@ -16,18 +16,18 @@ async function waitForEndpoint(url: string, delay = 1000): Promise { export async function setup(): Promise { // Spin up the database - spawn('docker', ['compose', 'up', 'db', '--detach'], { - cwd: '..', + spawn("docker", ["compose", "up", "db", "--detach"], { + cwd: "..", stdio: "pipe", }); - backendProcess = spawn('npm', ['run', 'dev'], { - cwd: '../backend', + backendProcess = spawn("npm", ["run", "dev"], { + cwd: "../backend", stdio: "pipe", }); // Wait until you can curl the backend - await waitForEndpoint('http://localhost:3000/api'); + await waitForEndpoint("http://localhost:3000/api"); } export async function teardown(): Promise { @@ -35,8 +35,8 @@ export async function teardown(): Promise { backendProcess.kill(); } - spawn('docker', ['compose', 'down'], { - cwd: '..', - stdio: "pipe" + spawn("docker", ["compose", "down"], { + cwd: "..", + stdio: "pipe", }); } diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 2a75f180..2269cd64 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -10,7 +10,7 @@ export default mergeConfig( exclude: [...configDefaults.exclude, "e2e/**"], root: fileURLToPath(new URL("./", import.meta.url)), // Startup the backend server, because it is needed for some tests - globalSetup: [ "./tests/setup-backend.ts" ] + globalSetup: ["./tests/setup-backend.ts"], }, }), );