Skip to content

Commit abac8f5

Browse files
committed
Passes on local windows
1 parent dd57c0f commit abac8f5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

lib/helpers/posix.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import path from "node:path";
2+
3+
export const toPosix = (location: string) =>
4+
path.sep === "\\" ? location.replaceAll("\\", "/") : location;

lib/step-definitions.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010

1111
import { getStepDefinitionPatterns, pathParts } from "./step-definitions";
1212

13+
import { toPosix } from "./helpers/posix"
14+
1315
const DUMMY_CONFIG: ICypressRuntimeConfiguration = {
1416
testingType: "e2e",
1517
projectRoot: "",
@@ -58,7 +60,7 @@ function example(
5860
}
5961

6062
for (let i = 0; i < expected.length; i++) {
61-
if (expected[i] !== actual[i]) {
63+
if (expected[i] !== toPosix(actual[i])) {
6264
throwUnequal();
6365
}
6466
}
@@ -72,7 +74,7 @@ describe("pathParts()", () => {
7274
it(`should return ${util.inspect(expectedParts)} for ${util.inspect(
7375
relativePath,
7476
)}`, () => {
75-
assert.deepStrictEqual(pathParts(relativePath), expectedParts);
77+
assert.deepStrictEqual(pathParts(relativePath).map(toPosix), expectedParts);
7678
});
7779
});
7880

lib/subpath-entrypoints/esbuild.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import { ensure } from "../helpers/assertions";
1010

1111
import { default as origDebug } from "../helpers/debug";
1212

13-
const debug = origDebug.extend("esbuild");
13+
import { toPosix } from "../helpers/posix";
1414

15-
const toPosix = (location: string) =>
16-
path.sep === "\\" ? location.replaceAll("\\", "/") : location;
15+
const debug = origDebug.extend("esbuild");
1716

1817
export function createEsbuildPlugin(
1918
configuration: Cypress.PluginConfigOptions,

0 commit comments

Comments
 (0)