From 076f330185ea276a9e44300a551d870779a4cc98 Mon Sep 17 00:00:00 2001 From: Sugui Date: Sun, 21 Apr 2024 12:49:38 +0200 Subject: [PATCH] Small fixes --- test/imageController.test.ts | 2 +- test/imageService.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/imageController.test.ts b/test/imageController.test.ts index ea35df1..0ac227b 100644 --- a/test/imageController.test.ts +++ b/test/imageController.test.ts @@ -3,7 +3,7 @@ import app from "src/app"; import request from "supertest"; import * as imageService from "src/services/imageService"; -afterAll(() => { +afterEach(() => { jest.restoreAllMocks(); }) diff --git a/test/imageService.test.ts b/test/imageService.test.ts index 5f909c0..dbcbc0f 100644 --- a/test/imageService.test.ts +++ b/test/imageService.test.ts @@ -1,4 +1,4 @@ -import { afterAll, describe, expect, it, jest, mock, spyOn } from "bun:test"; +import { afterAll, afterEach, describe, expect, it, jest, mock, spyOn } from "bun:test"; import Image from "src/types/Image"; import request from "supertest"; import * as gelbooruApiService from "src/services/gelbooruApiService"; @@ -7,12 +7,12 @@ import * as imageService from "src/services/imageService"; import app from "src/app"; import { response } from "express"; -afterAll(() => { +afterEach(() => { jest.restoreAllMocks(); }) describe("the service is thread-safe", () => { - it("should not crash when multiple processes call the get() method with 1 remaining image in the queue", async () => { + it("should not crash when multiple processes call the get() method simultaneously", async () => { const NUM_OF_REQUESTS = 110; const getFn = spyOn(imageService, "get");