style: fix deno fmt on students tests and drizzle.config
Check Deno code / Check Deno code (pull_request) Failing after 8s
Tests / Unit tests (pull_request) Successful in 11s
Tests / Integration tests (pull_request) Successful in 58s

This commit is contained in:
2026-04-26 14:18:09 +02:00
parent e5c6c389ea
commit cd5c524ff0
3 changed files with 26 additions and 6 deletions
+19 -4
View File
@@ -65,7 +65,12 @@ Deno.test("mock API: GET /students/:numEtud returns one student", async () => {
});
Deno.test("mock API: GET /students/:numEtud 404 when not found", async () => {
mockFetch({ "/students/99999": { status: 404, body: { error: "Ressource introuvable" } } });
mockFetch({
"/students/99999": {
status: 404,
body: { error: "Ressource introuvable" },
},
});
try {
const res = await fetch("http://localhost/api/students/99999");
assertEquals(res.status, 404);
@@ -81,7 +86,11 @@ Deno.test("mock API: POST /students creates student", async () => {
const res = await fetch("http://localhost/api/students", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ nom: "Dupont", prenom: "Jean", idPromo: "4AFISE25/26" }),
body: JSON.stringify({
nom: "Dupont",
prenom: "Jean",
idPromo: "4AFISE25/26",
}),
});
assertEquals(res.status, 201);
const data: Student = await res.json();
@@ -93,12 +102,18 @@ Deno.test("mock API: POST /students creates student", async () => {
Deno.test("mock API: PUT /students/:numEtud updates student", async () => {
const updated = { ...students[0], nom: "Dupont-Modifié" };
mockFetch({ "/students/21212006": { method: "PUT", status: 200, body: updated } });
mockFetch({
"/students/21212006": { method: "PUT", status: 200, body: updated },
});
try {
const res = await fetch("http://localhost/api/students/21212006", {
method: "PUT",
headers: { "content-type": "application/json" },
body: JSON.stringify({ nom: "Dupont-Modifié", prenom: "Jean", idPromo: "4AFISE25/26" }),
body: JSON.stringify({
nom: "Dupont-Modifié",
prenom: "Jean",
idPromo: "4AFISE25/26",
}),
});
assertEquals(res.status, 200);
const data: Student = await res.json();