Skip to content

Commit

Permalink
test(cli): pass an url to cwd
Browse files Browse the repository at this point in the history
This should fix failing on Windows
  • Loading branch information
hasundue committed Jul 28, 2024
1 parent 8c86c94 commit 83edb5a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cli/main_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assertEquals } from "@std/assert";
import { stripAnsiCode } from "@std/fmt/colors";
import { fromFileUrl } from "@std/path";
import { describe, it } from "@std/testing/bdd";
import dedent from "dedent";

Expand All @@ -11,13 +12,11 @@ interface CommandResult {

async function molt(argstr: string): Promise<CommandResult> {
const args = argstr.split(" ").filter((it) => it.length);

const main = new URL("./main.ts", import.meta.url).pathname;
const cwd = new URL("./fixtures", import.meta.url).pathname;
const main = fromFileUrl(new URL("./main.ts", import.meta.url));

const { code, stderr, stdout } = await new Deno.Command("deno", {
args: ["run", "-A", main, "--dry-run", ...args],
cwd,
cwd: new URL("./fixtures", import.meta.url),
}).output();

const format = (bytes: Uint8Array) =>
Expand Down

0 comments on commit 83edb5a

Please sign in to comment.