Skip to content

Make tests pass on Windows#153

Open
JohnGurin wants to merge 1 commit intoprojectwallace:mainfrom
JohnGurin:fix-tests-eol
Open

Make tests pass on Windows#153
JohnGurin wants to merge 1 commit intoprojectwallace:mainfrom
JohnGurin:fix-tests-eol

Conversation

@JohnGurin
Copy link
Copy Markdown

When there is no git global setting for aoutocrlf, git checkouts files with EOLs accordingly to the platform.
On Windows with CRLF tests become broken.

Using platform's EOLs does not completely help.

// src/components.ts
import { EOL } from 'node:os'
[...].join(/*'\n' -> */ EOL)

Snapshots have file size in them which differs because CRLF is two chars.

# Heading output for `bol-dot-com.css`
───────────────────────────────────────────────────────────
Lines of Code │ Filesize │ Rules │ Selectors │ Declarations
17,818        │ 468.9KB  │ 4,757 │ 6,664     │ 10,083  <-- size in file content
17,818        │ 469KB    │ 4,757 │ 6,664     │ 10,083  <-- actual file size (when CRLF)
───────────────────────────────────────────────────────────

Adding explicit line endings for the test files in .gitattributes makes tests pass on Windows.

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.

1 participant