Skip to content

Commit

Permalink
add .with_todo. to run test with --todo & add ut ti bundler_string_…
Browse files Browse the repository at this point in the history
…2 test
  • Loading branch information
pfgithub committed Nov 26, 2024
1 parent 29de7f2 commit 0f52408
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
4 changes: 3 additions & 1 deletion scripts/runner.node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,9 @@ async function spawnBunTest(execPath, testPath, options = { cwd }) {
const perTestTimeout = Math.ceil(timeout / 2);
const absPath = join(options["cwd"], testPath);
const isReallyTest = isTestStrict(testPath) || absPath.includes("vendor");
const args = options["args"] ?? [];
const wantsTodoFlag = testPath.includes(".with_todo.");
let args = options["args"] ?? [];
if (wantsTodoFlag) args = [...args, "--todo"];
const { ok, error, stdout } = await spawnBun(execPath, {
args: isReallyTest ? ["test", ...args, `--timeout=${perTestTimeout}`, absPath] : [...args, absPath],
cwd: options["cwd"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,6 @@ for (const testdef of file_cont.split("/*=")) {
if (REQUIRE_EXACT_ERROR_NAMES) expect(bunerrored).toInclude(terr.trim());
}
};
function syncExecPromise<T>(v: () => Promise<T>): { err: unknown; res: T | null } {
let err = null;
let res: T | null = null;
let success = false;
expect(
(async (): Promise<number> => {
try {
res = await v();
} catch (e) {
err = e;
}
success = true;
return 0;
})(),
).resolves.toBe(0);
if (!success) throw new Error("promise did not sync exec");
return { err, res };
}
test.todoIf(req_todo)(tname, testcb);
}

Expand Down

0 comments on commit 0f52408

Please sign in to comment.