From 24b7118f7f3775651e7d430e7b3fa8cdd374a009 Mon Sep 17 00:00:00 2001 From: Ze-Zheng Wu Date: Sun, 1 Dec 2024 11:01:15 +0800 Subject: [PATCH] fix: await async assertions in tests --- tests/blackbox.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/blackbox.test.ts b/tests/blackbox.test.ts index 7cba6e97..b5d1818d 100644 --- a/tests/blackbox.test.ts +++ b/tests/blackbox.test.ts @@ -152,7 +152,7 @@ for (const { }); // Snapshot - expect(snapshotResult(barcode)).toMatchFileSnapshot( + await expect(snapshotResult(barcode)).toMatchFileSnapshot( resolve( import.meta.dirname, `./__snapshots__/${directory}/${imageName}/${type}-${rotation}.json`, @@ -233,7 +233,7 @@ for (const { } }); } - test.sequential(`${directory} summary`, () => { + test.sequential(`${directory} summary`, async () => { for (const type of types) { for (const _summary of Object.values(summary[type]!)) { _summary!.failures = new Set([ @@ -254,7 +254,7 @@ for (const { } } } - expect(`${JSON.stringify(summary, null, 2)}\n`).toMatchFileSnapshot( + await expect(`${JSON.stringify(summary, null, 2)}\n`).toMatchFileSnapshot( resolve( import.meta.dirname, `./__snapshots__/${directory}/summary.json`,