Skip to content

Commit 63fafe3

Browse files
authored
build: normalize filepath slashes, eol consistency #6353
## Problem - Tests were failing or behaving inconsistently on different operating systems due to improper file path normalization. - End-of-line (EOL) conflicts were causing unnecessary formatting diffs in collaborative workflows. ## Solution - Updated the testFile variable in the test runner to normalize paths by replacing backslashes (\) with forward slashes, ensuring cross-platform compatibility. - Added the Prettier rule 'prettier/prettier': ['error', { endOfLine: 'auto' }] to align EOL behavior with the host environment, avoiding platform-specific conflicts.
1 parent c6d3c12 commit 63fafe3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,7 @@ module.exports = {
209209
],
210210
},
211211
],
212+
213+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
212214
},
213215
}

packages/core/src/test/testRunner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ export async function runTests(
8484
})
8585

8686
const dist = path.resolve(root, 'dist')
87-
const testFile = process.env['TEST_FILE']?.replace('.ts', '.js')
87+
const rawTestFile = process.env['TEST_FILE']
88+
const testFile = rawTestFile?.replace(/\\/g, '/').replace('.ts', '.js')
8889
let testFilePath: string | undefined
8990
if (testFile?.includes('../core/')) {
9091
testFilePath = path.resolve(root, testFile.replace('../core/', '../core/dist/'))

0 commit comments

Comments
 (0)