Conversation
Fixes a macOS-specific failure caused by `/var` vs `/private/var` path expansion
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request updates the scaffold plugin unit tests to use regex matching for error messages, improving flexibility in path validation. A review comment correctly identifies that hardcoded forward slashes in one of the new regex patterns will cause failures on Windows, suggesting a more generic pattern for better cross-platform compatibility.
| """ | ||
| Error: Invalid plugin slug specified. No such target directory '{RUN_DIR}/wp-content/plugins/foo'. | ||
| """ | ||
| Then STDERR should match #Error: Invalid plugin slug specified\. No such target directory '.*wp-content/plugins/foo'\.# |
There was a problem hiding this comment.
The regex uses hardcoded forward slashes (/) in the path wp-content/plugins/foo. On Windows, these separators are typically backslashes, which will cause the test to fail. Since this pull request is intended to improve Windows compatibility, the regex should be more flexible. Simplifying it to .*foo (matching the style used on line 271) would resolve this and maintain consistency across the test suite.
Then STDERR should match #Error: Invalid plugin slug specified\. No such target directory '.*foo'\.#
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes a macOS-specific failure caused by
/varvs/private/varpath expansion