Skip to content

Commit

Permalink
fix: fixed test cases on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
FabulousCodingFox authored and shepherdjerred committed Oct 4, 2024
1 parent dbae1f4 commit 9183350
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from "vitest";
import { getFilePath } from "./util.js";
import { tmpdir } from "os";
import { join } from "path";
import { join, normalize } from "path";
import { mkdir, mkdtemp, writeFile } from "fs/promises";

test("getFilePath index", async () => {
Expand All @@ -18,7 +18,7 @@ test("getFilePath index", async () => {
// change the current working directory back to the original
process.chdir(__dirname);

expect(result).toBe("index.html");
expect(normalize(result)).toBe(normalize("index.html"));
});

test("getFilePath 404", async () => {
Expand All @@ -35,7 +35,7 @@ test("getFilePath 404", async () => {
// change the current working directory back to the original
process.chdir(__dirname);

expect(result).toBe("404.html");
expect(normalize(result)).toBe(normalize("404.html"));
});

test("getFilePath blog", async () => {
Expand All @@ -53,7 +53,7 @@ test("getFilePath blog", async () => {
// change the current working directory back to the original
process.chdir(__dirname);

expect(result).toBe("blog/index.html");
expect(normalize(result)).toBe(normalize("blog/index.html"));
});

// https://sdorra.dev/posts/2024-02-12-vitest-tmpdir
Expand Down

0 comments on commit 9183350

Please sign in to comment.