From e407797735c8a8c888ee53fa1a7b17a4fcdea96c Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Mon, 15 Jan 2024 15:01:32 +0300 Subject: [PATCH] Fixed I/O tests randomly failing --- tests/unit/utils/io/file-info.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/utils/io/file-info.spec.ts b/tests/unit/utils/io/file-info.spec.ts index 3318a41..8a93ca9 100644 --- a/tests/unit/utils/io/file-info.spec.ts +++ b/tests/unit/utils/io/file-info.spec.ts @@ -102,15 +102,15 @@ describe("FileInfo", () => { }); describe("stream", () => { - test("creates a readable stream", () => { + test("creates a readable stream", () => new Promise(resolve => { const info = new FileInfo("path/to/test.txt"); const stream = info.stream(); expect(stream).toBeDefined(); expect(stream.readable).toBe(true); - stream.close(); - }); + stream.close(resolve); + })); }); describe("buffer", () => {