Small fixes
This commit is contained in:
parent
2f140996d5
commit
076f330185
|
@ -3,7 +3,7 @@ import app from "src/app";
|
||||||
import request from "supertest";
|
import request from "supertest";
|
||||||
import * as imageService from "src/services/imageService";
|
import * as imageService from "src/services/imageService";
|
||||||
|
|
||||||
afterAll(() => {
|
afterEach(() => {
|
||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -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 Image from "src/types/Image";
|
||||||
import request from "supertest";
|
import request from "supertest";
|
||||||
import * as gelbooruApiService from "src/services/gelbooruApiService";
|
import * as gelbooruApiService from "src/services/gelbooruApiService";
|
||||||
|
@ -7,12 +7,12 @@ import * as imageService from "src/services/imageService";
|
||||||
import app from "src/app";
|
import app from "src/app";
|
||||||
import { response } from "express";
|
import { response } from "express";
|
||||||
|
|
||||||
afterAll(() => {
|
afterEach(() => {
|
||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("the service is thread-safe", () => {
|
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 NUM_OF_REQUESTS = 110;
|
||||||
|
|
||||||
const getFn = spyOn(imageService, "get");
|
const getFn = spyOn(imageService, "get");
|
||||||
|
|
Loading…
Reference in New Issue