Skip to content

Commit

Permalink
test/fixtures: Convert to async-await to workaround TS 4.9.3 regression
Browse files Browse the repository at this point in the history
Change-type: patch
See: microsoft/TypeScript#51554
  • Loading branch information
thgreasi committed Nov 16, 2022
1 parent 8ea214e commit c479361
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/test-lib/fixtures.ts
Expand Up @@ -436,11 +436,12 @@ export const load = async (fixtureName?: string): Promise<Fixtures> => {
.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(
Expand Down

0 comments on commit c479361

Please sign in to comment.