Skip to content

fix: add .gitattributes to prevent CRLF corruption of test fixtures on Windows#1415

Open
UjjwalKumar239 wants to merge 1 commit into
expressjs:mainfrom
UjjwalKumar239:fix/windows-crlf-test-fixtures
Open

fix: add .gitattributes to prevent CRLF corruption of test fixtures on Windows#1415
UjjwalKumar239 wants to merge 1 commit into
expressjs:mainfrom
UjjwalKumar239:fix/windows-crlf-test-fixtures

Conversation

@UjjwalKumar239

Copy link
Copy Markdown

Problem

On Windows, Git's automatic CRLF line ending conversion corrupts binary
test fixture files (.dat), causing 12 test failures due to file size
mismatches (expected 1778 bytes, got 1803 bytes — a difference of 25 bytes
matching exactly 25 \r characters added by Windows).

Fix

  • Added .gitattributes marking test/files/*.dat and test/files/*.jpg
    as binary to prevent line ending conversion on any OS
  • Fixed hardcoded Unix path separator /testforme-testforme- in
    test/functionality.js for cross-platform compatibility

Testing

All 72 tests now pass on Windows.

…n Windows

Test fixture .dat files were being corrupted by Windows CRLF line ending
conversion, causing file size mismatches (1778 vs 1803 bytes). Also fixed
a hardcoded Unix path separator in functionality.js test assertion.

Fixes test failures on Windows for:
- Disk Storage tests
- Memory Storage tests
- Reuse Middleware tests
- Select Field tests
- Functionality tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants