diff --git a/lib/git_test.ts b/lib/git_test.ts index 956cac85..1254a0b6 100644 --- a/lib/git_test.ts +++ b/lib/git_test.ts @@ -34,6 +34,10 @@ class DenoCommandStub { } } +function normalizePath(path: string) { + return Deno.build.os === "windows" ? path.replaceAll("/", "\\") : path; +} + describe("commitAll()", () => { let output: { path: string; content: string }[] = []; let updates: DependencyUpdate[]; @@ -115,9 +119,8 @@ describe("commitAll()", () => { 'git commit -m "build(deps): update node-emoji"', "git add test/fixtures/direct-import/mod.ts", 'git commit -m "build(deps): update deno.land/x/deno_graph"', - // "git add test/fixtures/direct-import/mod.ts test/fixtures/direct-import/lib.ts", 'git commit -m "build(deps): update deno.land/std"', - ], + ].map(normalizePath), ); }); @@ -134,7 +137,7 @@ describe("commitAll()", () => { 'git commit -m "build(deps): update test/fixtures/direct-import/mod.ts"', "git add test/fixtures/direct-import/lib.ts", 'git commit -m "build(deps): update test/fixtures/direct-import/lib.ts"', - ], + ].map(normalizePath), ); }); }); diff --git a/lib/uri.ts b/lib/uri.ts index 18302dcc..77b8bb8f 100644 --- a/lib/uri.ts +++ b/lib/uri.ts @@ -44,7 +44,7 @@ export const URI = { return relative(URI.cwd, uri) as RelativePath; }, absolute(uri: URI<"file">): AbsolutePath { - return resolve(new URL(uri).pathname) as AbsolutePath; + return new URL(uri).pathname as AbsolutePath; }, ensure(...schemes: S[]): (uri: string) => URI { return (uri) => {