Skip to content

Commit c62472f

Browse files
Fix cross-platform path separators in walker
Normalize paths to forward slashes so walker snapshot passes on both Windows and Linux (CI). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fdeeaca commit c62472f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/walker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const checkIfFileShouldBeIgnored = (fullPath) => {
1616
const walk = (rootDir, allFiles = []) => {
1717
const files = fs.readdirSync(rootDir);
1818
files.forEach((file) => {
19-
const fullPath = path.join(rootDir, file);
19+
const fullPath = path.join(rootDir, file).split(path.sep).join('/');
2020
if (fs.statSync(fullPath).isDirectory()) {
2121
if (!checkIfDirectoryShouldBeIgnored(fullPath)) {
2222
walk(fullPath, allFiles);

test/__snapshots__/walker.spec.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
exports[`walker walk should return list of all files in directory 1`] = `
44
[
5-
"test\\walking_test\\a.js",
6-
"test\\walking_test\\directory\\b.jsx",
7-
"test\\walking_test\\directory\\e.tsx",
8-
"test\\walking_test\\f.ts",
5+
"test/walking_test/a.js",
6+
"test/walking_test/directory/b.jsx",
7+
"test/walking_test/directory/e.tsx",
8+
"test/walking_test/f.ts",
99
]
1010
`;

0 commit comments

Comments
 (0)