Skip to content

test: bring master's suite back to green after errors were turned on in the tests - #172

Open
xyrolle wants to merge 4 commits into
thecodrr:masterfrom
xyrolle:fix/master-tests
Open

xyrolle wants to merge 4 commits into
thecodrr:masterfrom
xyrolle:fix/master-tests

Conversation

@xyrolle

@xyrolle xyrolle commented Oct 26, 2026

Copy link
Copy Markdown

Master's suite has failed 19 tests since eb6136b turned on .withErrors() in the tests (they pass on v6.5.0). This brings it back to green, one cause per commit:

  • "crawl directory with options" lost its const files = await api[type]() line in that edit, so both API types threw files is not defined.
  • "do not add a separator if path already ends with one" (4a2a6b3) calls normalizePath without importing it.
  • The shared symlink fixtures held a broken link (fileSymlink2 → a missing file), which the tests silently skipped while errors were suppressed. With .withErrors(), every test crawling /some/dir or relative/dir threw ENOENT on it. The link is gone from the shared fixtures, and a broken link now has tests of its own, for both API types: listed by name when symlinks are not resolved, skipped when they are, and reported when .withErrors() is on.
  • "crawl all files and invert path separator" fails on Linux and macOS because of a real bug, not the test. The walker reads the disk through the output path, so a \\ separator reaches readdir (ENOENT: scandir 'node_modules\'); the test only passed before because the error was suppressed and an empty result satisfies every(). The test is marked test.fails on POSIX only, since on Windows a / separator still works, with a comment saying why. A separate PR fixes the walker, which keeps native paths for the file system, and removes the marker.

npx vitest run: 112 passed (106 before, plus 6 new). npx prettier --check __tests__ is clean.

This branch has not been deployed

No deployments
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