File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1+ import path from "node:path" ;
2+
3+ export const toPosix = ( location : string ) =>
4+ path . sep === "\\" ? location . replaceAll ( "\\" , "/" ) : location ;
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
1010
1111import { getStepDefinitionPatterns , pathParts } from "./step-definitions" ;
1212
13+ import { toPosix } from "./helpers/posix"
14+
1315const 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
Original file line number Diff line number Diff line change @@ -10,10 +10,9 @@ import { ensure } from "../helpers/assertions";
1010
1111import { 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
1817export function createEsbuildPlugin (
1918 configuration : Cypress . PluginConfigOptions ,
You can’t perform that action at this time.
0 commit comments