test(native-watcher): init native watcher tests#12185
Merged
Conversation
✅ Deploy Preview for rspack canceled.
|
fdfdf92 to
e093f25
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR initializes test infrastructure and test cases for the native file system watcher functionality in rspack. It adds comprehensive test helpers, macros for convenient test setup, and an initial test case to validate watcher behavior.
Key Changes
- Added test helper infrastructure with event collection and assertion utilities
- Introduced convenience macros for concise test setup and execution
- Added
Defaulttrait implementation forFsWatcherOptionsto simplify test configuration - Enhanced
ArcPathwithAsRef<Path>implementation for better interoperability
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_watcher/tests/watcher.rs | New test file with macros and initial watcher test case |
| crates/rspack_watcher/tests/helpers/mod.rs | Test helper infrastructure for managing temp directories, events, and watcher lifecycle |
| crates/rspack_watcher/src/lib.rs | Added Default trait for options and test-only poll_interval field |
| crates/rspack_paths/src/lib.rs | Added AsRef<Path> implementation for ArcPath |
| crates/rspack_watcher/Cargo.toml | Added tempfile dev dependency for test isolation |
| Cargo.lock | Updated lockfile with tempfile and its transitive dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
🎉 Size decreased by 662.50KB from 48.10MB to 47.45MB (⬇️1.35%) |
CodSpeed Performance ReportMerging #12185 will not alter performanceComparing Summary
|
61b8b76 to
11db042
Compare
GiveMe-A-Name
approved these changes
Nov 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Initialize native watcher test cases.
Port https://github.com/webpack/watchpack/blob/b45446602cb428052d4b7800862d79da41f312bc/test/Watchpack.js#L18
Related links
Checklist