From b43165b1b76d8a7b84dce19938baeb6a1e9c4df4 Mon Sep 17 00:00:00 2001 From: Talgat Saribayev Date: Wed, 8 Nov 2023 12:01:15 +0600 Subject: [PATCH] update exercise5 --- exercise5/problem8/index.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exercise5/problem8/index.test.ts b/exercise5/problem8/index.test.ts index 6dd7ceb..e627578 100644 --- a/exercise5/problem8/index.test.ts +++ b/exercise5/problem8/index.test.ts @@ -185,7 +185,16 @@ describe("exercise5 - problem7", () => { expect(fetchMock).toBeCalledTimes(0); const resPromise = fetchCharacterWithMovies(4); expect(fetchMock).toBeCalledTimes(1); - await resPromise; + await vi.runOnlyPendingTimersAsync(); + await expect(resPromise).resolves.toStrictEqual({ + name: character.name, + films: [ + movies[0].title, + movies[1].title, + movies[2].title, + movies[3].title, + ], + }); expect(fetchMock).toBeCalledTimes(1 + movies.length); });