Skip to content

Commit

Permalink
Add workarounds for silent before/after errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Mar 28, 2022
1 parent a0b5343 commit 550cb55
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 15 deletions.
20 changes: 17 additions & 3 deletions src/test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,26 @@ import {WireitTestRig} from './util/test-rig.js';
const test = suite<{rig: WireitTestRig}>();

test.before.each(async (ctx) => {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
try {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu before error', error);
process.exit(1);
}
});

test.after.each(async (ctx) => {
await ctx.rig.cleanup();
try {
await ctx.rig.cleanup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu after error', error);
process.exit(1);
}
});

test(
Expand Down
20 changes: 17 additions & 3 deletions src/test/errors-analysis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,26 @@ import {WireitTestRig} from './util/test-rig.js';
const test = suite<{rig: WireitTestRig}>();

test.before.each(async (ctx) => {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
try {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu before error', error);
process.exit(1);
}
});

test.after.each(async (ctx) => {
await ctx.rig.cleanup();
try {
await ctx.rig.cleanup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu after error', error);
process.exit(1);
}
});

test(
Expand Down
20 changes: 17 additions & 3 deletions src/test/errors-usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,26 @@ import {WireitTestRig} from './util/test-rig.js';
const test = suite<{rig: WireitTestRig}>();

test.before.each(async (ctx) => {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
try {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu before error', error);
process.exit(1);
}
});

test.after.each(async (ctx) => {
await ctx.rig.cleanup();
try {
await ctx.rig.cleanup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu after error', error);
process.exit(1);
}
});

test(
Expand Down
20 changes: 17 additions & 3 deletions src/test/freshness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,26 @@ import {shuffle} from '../util/shuffle.js';
const test = suite<{rig: WireitTestRig}>();

test.before.each(async (ctx) => {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
try {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu before error', error);
process.exit(1);
}
});

test.after.each(async (ctx) => {
await ctx.rig.cleanup();
try {
await ctx.rig.cleanup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu after error', error);
process.exit(1);
}
});

test(
Expand Down
20 changes: 17 additions & 3 deletions src/test/watch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,26 @@ import {WireitTestRig} from './util/test-rig.js';
const test = suite<{rig: WireitTestRig}>();

test.before.each(async (ctx) => {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
try {
ctx.rig = new WireitTestRig();
await ctx.rig.setup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu before error', error);
process.exit(1);
}
});

test.after.each(async (ctx) => {
await ctx.rig.cleanup();
try {
await ctx.rig.cleanup();
} catch (error) {
// Uvu has a bug where it silently ignores failures in before and after,
// see https://github.com/lukeed/uvu/issues/191.
console.error('uvu after error', error);
process.exit(1);
}
});

test(
Expand Down

0 comments on commit 550cb55

Please sign in to comment.