From ba60669391c0ddbd1e60ddaba15b25d3213bfbba Mon Sep 17 00:00:00 2001 From: Sugui Date: Thu, 28 Mar 2024 16:52:39 +0100 Subject: [PATCH] Cleaning --- src/services/ImageService.ts | 3 ++- test/ImageService.test.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/ImageService.ts b/src/services/ImageService.ts index 1826b8d..2b8ca37 100644 --- a/src/services/ImageService.ts +++ b/src/services/ImageService.ts @@ -5,7 +5,7 @@ import GelbooruApiService from "./GelbooruApiService"; class ImageService { postsQueue: Image[] = []; - + async get(): Promise { while (this.postsQueue.length === 0) { const validPosts = await this.getNewValidImages(); @@ -13,6 +13,7 @@ class ImageService { } return this.postsQueue.pop() as Image; } + private async getNewValidImages(): Promise { const gelbooruResponse: GelbooruServiceResponse = await GelbooruApiService.get(); const posts = gelbooruResponse.posts; diff --git a/test/ImageService.test.ts b/test/ImageService.test.ts index 989cff0..35c907c 100644 --- a/test/ImageService.test.ts +++ b/test/ImageService.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeAll, describe, expect, it, mock } from "bun:test"; +import { describe, expect, it, mock } from "bun:test"; import Image from "../src/types/Image" import ImageService from "../src/services/ImageService"; import GelbooruApiResponse from "../src/types/GelbooruServiceResponse";