Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { randomBytes } from "node:crypto";
import { existsSync, mkdtempSync, rmSync } from "node:fs";
import { existsSync, mkdtempSync } from "node:fs";
import { rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { expect } from "chai";
Expand Down Expand Up @@ -79,7 +80,7 @@ function runState(): Promise<JourneyState> {
/** Removes the run's scratch and evidence folder once every journey passed; a failure keeps it for whoever reads the failure. */
async function removeRunUnlessFailed(): Promise<void> {
if (failed || run === undefined) return;
rmSync((await run).dir, { recursive: true, force: true });
await rm((await run).dir, { recursive: true, force: true });
}

/** Gives the next journey a workspace that never opened Mailing, under the module's default configuration. */
Expand Down Expand Up @@ -135,7 +136,10 @@ export function describeJourneys(
}
if (!cleanupRegistered) {
cleanupRegistered = true;
after(removeRunUnlessFailed);
after(function () {
this.timeout(RESET_TIMEOUT_MS);
return removeRunUnlessFailed();
});
}
describe(`[journeys] ${feature}`, function () {
this.timeout(RESET_TIMEOUT_MS);
Expand Down
Loading