Skip to content

Commit

Permalink
fix for win
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Aug 29, 2024
1 parent 721944e commit f1699bc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable jest/expect-expect */
import childProcess from "child_process";
import path from "path";
import { testIfNodeMajorVersionIsLessThan18 } from "../../utils/testIf";
import { testIf, testIfNodeMajorVersionIsLessThan18 } from "../../utils/testIf";

function checkBundleForDebugIds(bundlePath1: string, bundlePath2: string): string[] {
const process1Output = childProcess.execSync(`node ${bundlePath1}`, { encoding: "utf-8" });
Expand Down Expand Up @@ -38,15 +38,21 @@ function checkBundleForRelease(bundlePath: string): void {
expect(JSON.parse(processOutput).release).toBe("I AM A RELEASE!");
}

test("vite bundle", () => {
testIf(
// query params and fragments are weird on windows
process.platform !== "win32"
)("vite bundle", () => {
checkBundleForDebugIds(
path.join(__dirname, "out", "vite", "bundle1.js?foo=bar#baz"),
path.join(__dirname, "out", "vite", "bundle2.js?foo=bar#baz")
);
checkBundleForRelease(path.join(__dirname, "out", "vite", "bundle1.js?foo=bar#baz"));
});

test("rollup bundle", () => {
testIf(
// query params and fragments are weird on windows
process.platform !== "win32"
)("rollup bundle", () => {
checkBundleForDebugIds(
path.join(__dirname, "out", "rollup", "bundle1.js?foo=bar#baz"),
path.join(__dirname, "out", "rollup", "bundle2.js?foo=bar#baz")
Expand Down

0 comments on commit f1699bc

Please sign in to comment.