Skip to content

Commit

Permalink
test: dont return something in TestFn
Browse files Browse the repository at this point in the history
this dont work in future @types/node versions (but Node.js doesnt seem to care)
  • Loading branch information
EdJoPaTo committed Jul 28, 2024
1 parent b0d47b7 commit dad0989
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 18 additions & 12 deletions source/body.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,24 @@ async function macro(
wrongs: readonly unknown[],
): Promise<void> {
await test(fn.name, async t => {
await t.test('works', async t =>
Promise.all(works.map(async item =>
t.test(mehToString(item), () => {
strictEqual(fn(item), true);
}),
)));
await t.test('wrongs', async t =>
Promise.all(wrongs.map(async item =>
t.test(mehToString(item), () => {
strictEqual(fn(item), false);
}),
)));
await t.test('works', async t => {
await Promise.all(
works.map(async item =>
t.test(mehToString(item), () => {
strictEqual(fn(item), true);
}),
),
);
});
await t.test('wrongs', async t => {
await Promise.all(
wrongs.map(async item =>
t.test(mehToString(item), () => {
strictEqual(fn(item), false);
}),
),
);
});
});
}

Expand Down
4 changes: 3 additions & 1 deletion source/path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ await test('getMenuOfPath throws when not a path', () => {

await test('createRootMenuTrigger does not throw on good trigger', async t => {
const macro = async (trigger: string | RegExpLike) =>
t.test(String(trigger), () => createRootMenuTrigger(trigger));
t.test(String(trigger), () => {
createRootMenuTrigger(trigger);
});
await macro(/^blubb\//);
await macro('blubb/');
await macro(/^\//);
Expand Down

0 comments on commit dad0989

Please sign in to comment.