Files
yi111 7b8e95de3e test(hooks): pin golden hook fixtures to LF so the byte anchor holds on Windows (#497)
src/__tests__/hooks-golden.test.ts compares injectHooks() output against
fixtures/hooks/<tool>.json with expect(got).toBe(want), and readFile(..., 'utf-8')
does not normalise line endings. The repository has no .gitattributes, and Git for
Windows defaults to core.autocrlf=true, so all five fixtures were checked out with
CRLF and every case failed for anyone using default Windows git settings. CI stayed
green because the matrix only runs ubuntu-latest and macos-latest.

Pin them with `text eol=lf`, plus the same rule for .gitattributes itself so it stays
stable on Windows too. The fixture pattern matches only those five files, which only
hooks-golden.test.ts reads.
2026-09-11 13:19:12 +08:00

13 lines
666 B
Plaintext

# Keep this file itself LF so the rules below stay stable on Windows too.
/.gitattributes text eol=lf
# Hook output fixtures are compared byte-for-byte by
# src/__tests__/hooks-golden.test.ts ("兼容锚点", issue #19 §8): the injected
# settings must stay identical to the captured baseline so that an existing
# installation sees a zero-diff reconcile after a CLI upgrade.
#
# Git for Windows defaults to core.autocrlf=true, which rewrites these files to
# CRLF on checkout, so on Windows the comparison failed for every tool while CI
# (ubuntu/macos) stayed green. Pin them to LF so the anchor holds everywhere.
src/__tests__/fixtures/hooks/*.json text eol=lf