Skip to content

Commit 81f8103

Browse files
fix2: failing test in pipeline for windows
1 parent d6170f3 commit 81f8103

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

packages/project-access/test/library/helpers.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,12 @@ describe('validateId', () => {
291291
memFs = createEditor(store);
292292
memFsToStore.set(memFs, store);
293293

294+
// Helper to normalize paths for cross-platform consistency
295+
const normalizePath = (...parts: string[]) => join(...parts).replace(/\\/g, '/');
296+
294297
// Create test view files in memory
295298
memFs.write(
296-
join(testDir, 'webapp', 'view', 'Main.view.xml'),
299+
normalizePath(testDir, 'webapp', 'view', 'Main.view.xml'),
297300
`<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">
298301
<Page id="mainPage">
299302
<Button id="mainButton" text="Main" />
@@ -302,7 +305,7 @@ describe('validateId', () => {
302305
);
303306

304307
memFs.write(
305-
join(testDir, 'webapp', 'view', 'Detail.view.xml'),
308+
normalizePath(testDir, 'webapp', 'view', 'Detail.view.xml'),
306309
`<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">
307310
<Page id="detailPage">
308311
<Input id="detailInput" />
@@ -312,7 +315,7 @@ describe('validateId', () => {
312315

313316
// Create test fragment files
314317
memFs.write(
315-
join(testDir, 'webapp', 'fragment', 'Dialog.fragment.xml'),
318+
normalizePath(testDir, 'webapp', 'fragment', 'Dialog.fragment.xml'),
316319
`<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
317320
<Dialog id="testDialog">
318321
<Button id="dialogButton" text="OK" />
@@ -322,12 +325,12 @@ describe('validateId', () => {
322325

323326
// Create files that should be ignored (in excluded directories)
324327
memFs.write(
325-
join(testDir, 'annotations', 'annotation.xml'),
328+
normalizePath(testDir, 'annotations', 'annotation.xml'),
326329
`<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"><edmx:DataServices/></edmx:Edmx>`
327330
);
328331

329332
memFs.write(
330-
join(testDir, 'node_modules', 'test.view.xml'),
333+
normalizePath(testDir, 'node_modules', 'test.view.xml'),
331334
`<mvc:View xmlns:mvc="sap.ui.core.mvc"><Button id="shouldBeIgnored" /></mvc:View>`
332335
);
333336

@@ -409,8 +412,9 @@ describe('validateId', () => {
409412
memFsToStore.set(customMemFs, customStore);
410413

411414
const customDir = '/custom-project';
415+
const normalizePath = (...parts: string[]) => join(...parts).replace(/\\/g, '/');
412416
customMemFs.write(
413-
join(customDir, 'webapp', 'view', 'Custom.view.xml'),
417+
normalizePath(customDir, 'webapp', 'view', 'Custom.view.xml'),
414418
`<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">
415419
<Button id="customButton" />
416420
</mvc:View>`

0 commit comments

Comments
 (0)