From c4793616af0a7cadb0af44cdcf1d76f96ed6df46 Mon Sep 17 00:00:00 2001 From: Thodoris Greasidis Date: Wed, 16 Nov 2022 15:52:53 +0200 Subject: [PATCH] test/fixtures: Convert to async-await to workaround TS 4.9.3 regression Change-type: patch See: https://github.com/microsoft/TypeScript/issues/51554 --- test/test-lib/fixtures.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/test-lib/fixtures.ts b/test/test-lib/fixtures.ts index 4a6165093b..f6b2f05f0e 100644 --- a/test/test-lib/fixtures.ts +++ b/test/test-lib/fixtures.ts @@ -436,11 +436,12 @@ export const load = async (fixtureName?: string): Promise => { .map((file) => file.slice(0, -'.json'.length).trim()); for (const model of models) { - fixtures[model] = import( - path.join('../fixtures', fixtureName, `${model}.json`) - ).then(({ default: fromJson }) => - loadFixtureModel(loaders[model], fixtures, fromJson), - ); + fixtures[model] = (async () => { + const { default: fromJson } = await import( + path.join('../fixtures', fixtureName, `${model}.json`) + ); + return await loadFixtureModel(loaders[model], fixtures, fromJson); + })(); } return await Bluebird.props(