Fix/url mocking#75
Merged
Merged
Conversation
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.
This pull request introduces improvements to mock request rule handling and UI enhancements for the TWD testing tool. The main changes include more accurate URL matching for mock rules (especially for file extensions), a new sidebar button for viewing mock rule status, new icon components, and updates to tests and documentation.
Mock Rule Matching Enhancements:
findRuleto distinguish between URLs that are files (with extensions) and general endpoints, preventing accidental rule matches for file URLs unless the rule explicitly specifies a file extension. This logic is now shared between the CLI and mock service worker scripts. [1] [2] [3]UI Improvements:
MockRulesButtoncomponent to the sidebar, displaying the count of triggered and total mock rules, and allowing users to view rule details in the console. [1] [2] [3]Icon Components:
MockRequestIconand corresponding test coverage. [1] [2] [3]Test and Documentation Updates:
MockRulesButtoncomponent.Summary of Most Important Changes:
Mock rule matching logic:
findRuleand mock service workers to handle file extensions correctly, preventing endpoint rules from matching file URLs unless explicitly configured. [1] [2] [3]Sidebar and UI enhancements:
MockRulesButtonto the sidebar for viewing mock rule usage and details, with a new icon and improved sticky header layout. [1] [2] [3] [4] [5]MockRequestIconand its test to visually represent mock rules in the UI. [1] [2] [3]Test and documentation maintenance:
This closes #72