Refactor test URL and add new npm script

Updated the axios GET request in the backend test to use double quotes for consistency. Added a new 'fix' script in package.json for Biome to automatically fix and write unsafe changes. Changed var to let in global-setup.ts for better variable handling.
This commit is contained in:
Mathis H (Avnyr) 2024-10-15 11:29:56 +02:00
parent 8ee5410c91
commit 16487e5985
Signed by: Mathis
GPG Key ID: DD9E0666A747D126
3 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import axios from "axios";
describe("GET /api", () => { describe("GET /api", () => {
it("should return a message", async () => { it("should return a message", async () => {
const res = await axios.get(`/api`); const res = await axios.get("/api");
expect(res.status).toBe(200); expect(res.status).toBe(200);
expect(res.data).toEqual({ message: "Hello API" }); expect(res.data).toEqual({ message: "Hello API" });

View File

@ -1,5 +1,5 @@
/* eslint-disable */ /* eslint-disable */
var __TEARDOWN_MESSAGE__: string; let __TEARDOWN_MESSAGE__: string;
module.exports = async () => { module.exports = async () => {
// Start services that that the app needs to run (e.g. database, docker-compose, etc.). // Start services that that the app needs to run (e.g. database, docker-compose, etc.).

View File

@ -4,6 +4,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"check": "biome check --skip-errors --apply apps", "check": "biome check --skip-errors --apply apps",
"fix": "biome check --skip-errors --write --unsafe apps",
"db:generate": "drizzle-kit generate", "db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate", "db:migrate": "drizzle-kit migrate",
"db:studio": "drizzle-kit studio" "db:studio": "drizzle-kit studio"