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
12 changes: 11 additions & 1 deletion Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const { values: rawOptions } = parseArgs({
tests: { type: "string", short: "t" },
fix: { type: "boolean" },
debug: { type: "boolean" },
dirty: { type: "boolean" },

insiders: { type: "boolean" },

Expand Down Expand Up @@ -325,6 +326,12 @@ function goTest(taskName) {

async function runTests() {
warnIfTypeScriptSubmoduleNotCloned();

if (!options.dirty) {
await rimraf(localBaseline);
await fs.promises.mkdir(localBaseline, { recursive: true });
}

await $test`${gotestsum("tests")} ./... ${isCI ? ["--timeout=45m"] : []}`;
}

Expand Down Expand Up @@ -520,10 +527,13 @@ function baselineAcceptTask(localBaseline, refBaseline) {
};
}

const localBaseline = "testdata/baselines/local/";
const refBaseline = "testdata/baselines/reference/";

export const baselineAccept = task({
name: "baseline-accept",
description: "Makes the most recent test results the new baseline, overwriting the old baseline.",
run: baselineAcceptTask("testdata/baselines/local/", "testdata/baselines/reference/"),
run: baselineAcceptTask(localBaseline, refBaseline),
});

/**
Expand Down