-
Notifications
You must be signed in to change notification settings - Fork 29
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
Make unit tests pass on Windows #839
Conversation
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.
Nice work @fredrikekelund !
Are we ready to enable (and rename) "Experiment Windows Unit Tests" to start running them on CI side again?
I didn't know we'd already configured a CI job for that. I've enabled it again as part of this PR 👍 (Fingers crossed it works now…) |
Looks like the CI process indeed works 🙂 |
Thanks @fredrikekelund ! 🥳 |
* WIP - Make unit tests pass on Windows * Fix DefaultExporter tests * Abstract the path mocking logic * Exclude tests/utils from Jest config * SqlExporter * PlaygroundValidator * Normalize paths passed to fs.__setFileContents * Fix file name * User data tests * Enable unit tests on Windows * Remove "Experiment" from name
Related issues
Proposed Changes
This PR makes all unit tests pass on Windows by mocking the
path
module and/or using it correctly. Unsurprisingly, all of the failing tests were related to the differences between file paths on Unix and Windows…I've added
src/tests/utils/platform-test-suite.ts
that wraps a test suite in adescribe.each
call that iterates over Unix and Windows platforms (meaning we run a mock test suite for both platforms at all times). Having this wrapper should make it easier to implement future tests for code that uses thepath
module.Testing Instructions
Run
npm test
on Windows and make sure all tests passPre-merge Checklist