diff --git a/main.ts b/main.ts index de31ef3..a466e60 100644 --- a/main.ts +++ b/main.ts @@ -17,7 +17,7 @@ type Run = ( t: Omit, ) => (pathname: string, logs: Buffer) => Promise -const globalRunner = (f: Run) => { +const globalRunner = (f: Run, skipArg: string) => { return async ({ concurrency, skip, ...rest }: T, includePatterns: string) => { const include: string[] = [] for await ( @@ -44,7 +44,8 @@ const globalRunner = (f: Run) => { include.map((pathname) => async () => { const { frontmatter } = parseFrontmatter(pathname, await Deno.readTextFile(pathname), { test_skip(value) { - return value !== undefined + const skipArgs = new Set(value?.split(" ") ?? []) + return value === "" || skipArgs.has(skipArg) }, }) const quotedPathname = `"${pathname}"` @@ -92,15 +93,15 @@ await new Command() .command("deno") .arguments("") .option("-r, --reload ", "reload") - .action(globalRunner(runDeno)) + .action(globalRunner(runDeno, "deno")) .command("node") .arguments("") - .action(globalRunner(runNode)) + .action(globalRunner(runNode, "node")) .command("browser") .arguments("") .option("-b, --browser ", "browser binary") .option("-p, --project ", "project", { required: true }) .option("-r, --reload ", "reload", { required: true }) - .action(globalRunner(runBrowser)), + .action(globalRunner(runBrowser, "browser")), ) .parse(Deno.args)