Skip to content

Commit

Permalink
fix(setup.ts): backport setup fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Feb 21, 2021
1 parent dab4419 commit ee1aca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,10 @@ export async function withMockedFixture({
};

if (finalOptions.use) {
if (finalOptions.use?.[0].name != 'root') ctx.using.push(rootFixture());
if (finalOptions.use?.[0]?.name != 'root') ctx.using.push(rootFixture());
ctx.using = [...ctx.using, ...finalOptions.use];
// ? `describe-root` fixture doesn't have to be the last one, but a fixture
// ? with that name must be included at least once
if (!finalOptions.use.find((f) => f.name == 'describe-root'))
ctx.using.push(describeRootFixture());
} else ctx.using = [rootFixture(), describeRootFixture()];
Expand Down

0 comments on commit ee1aca2

Please sign in to comment.