Build: Refactor tests for windows#34714
Conversation
…nt tests and update regex for prompt loading test
There was a problem hiding this comment.
Pull request overview
This PR makes recently added React Native and eval tests platform-agnostic so they pass on Windows as well as POSIX environments. It fits into the repo’s cross-platform test stability work by removing path-separator assumptions from assertions.
Changes:
- Updated a prompt-loading test to accept either
/or\in the expected dispatcher path. - Added a small path-normalization helper in the React Native entrypoint tests.
- Normalized
path.relative(...)results before snapshot assertions so snapshots remain stable across platforms.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
scripts/eval/lib/utils.test.ts |
Makes the prompt path assertion accept Windows and POSIX separators. |
code/lib/create-storybook/src/generators/REACT_NATIVE/generateEntrypoint.test.ts |
Normalizes relative paths before snapshot checks in RN entrypoint tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR updates test code to handle cross-platform path separators, making snapshot assertions and path-matching regex patterns insensitive to OS differences. A ChangesCross-Platform Test Path Normalization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
Comment |
What I did
The tests I added for RN were not platform agnostic, so they failed on windows, this solves that problem.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
I do not think it's needed.
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>