-
Notifications
You must be signed in to change notification settings - Fork 91
fix(astro): sub folders not working on Windows #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
AriPerkkio
commented
Aug 7, 2024
- Fixes Subfolders on windows do not work #209
|
test('getFilesRefList returns files', async () => { | ||
const files = await getFilesRefList('test/fixtures/files', ''); | ||
|
||
expect(files).toMatchInlineSnapshot(` | ||
[ | ||
"test-fixtures-files.json", | ||
[ | ||
"/first.js", | ||
"/nested/directory/second.ts", | ||
], | ||
] | ||
`); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure on Windows CI before fix:
❯ src/default/utils/content/files-ref.spec.ts (1 test | 1 failed) 26ms ❯ src/default/utils/content/files-ref.spec.ts > getFilesRefList returns files → Snapshot `getFilesRefList returns files 1` mismatched ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL src/default/utils/content/files-ref.spec.ts > getFilesRefList returns files Error: Snapshot `getFilesRefList returns files 1` mismatched - Expected + Received [ "test-fixtures-files.json", [ "/first.js", - "/nested/directory/second.ts", + "/nested\directory\second.ts", ], ]
https://github.com/stackblitz/tutorialkit/actions/runs/10287876681/job/28471979082?pr=225
// create snapshot of lesson, solution and template file reference JSONs | ||
const lessonJsons = distFiles.filter((file) => file.endsWith('-files.json')); | ||
const solutionJsons = distFiles.filter((file) => file.endsWith('-solution.json')); | ||
const templateJsons = distFiles.filter((file) => file.startsWith('template-') && file.endsWith('.json')); | ||
|
||
const contents = [...lessonJsons, ...solutionJsons, ...templateJsons].reduce((jsons, current) => { | ||
const fileJson = JSON.parse(readFileSync(path.join(dest, 'dist', current), 'utf8')); | ||
const filenames = Object.keys(fileJson); | ||
|
||
return { ...jsons, [current]: filenames }; | ||
}, {}); | ||
|
||
expect(JSON.stringify(contents, null, 2)).toMatchSnapshot('built project file references'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is unrelated to the bug. I first thought the problem would be here and created this test case to see if it passes on Windows - it did.
It seems useful so let's include it as well.
c0af565
to
e44d4c8
Compare
@@ -5,6 +5,7 @@ on: | |||
branches: | |||
- main | |||
pull_request: | |||
workflow_dispatch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful for contributors. It allows them (and me) to run CI manually on specific branch on forks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a really nice addition! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good find! I like the clean up and the new test! 🤌
@@ -5,6 +5,7 @@ on: | |||
branches: | |||
- main | |||
pull_request: | |||
workflow_dispatch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a really nice addition! 😃