Repository navigation
Honor ignoreCallsFromThisFile() for ES modules with a quibble query - #130
Merged
Merged
Conversation
Fixes #99 quibble.esm() and quibble.esmImportWithPath() compared raw ESM stack-frame URLs against the ignore list. A wrapper imported while a mock existed has a `?__quibble=N` URL, so it was never skipped and specifiers resolved from the wrapper's directory instead of its caller's. Drop the query and hash from file: stack-frame URLs, as fileURLToPath() already does for path-mode callers. Also let ignoreCallsFromThisFile() take a file: URL such as import.meta.url, which the first change would otherwise stop matching.
Before Node 22, a module's import.meta.url and stack frames never carry quibble's `?__quibble=N` query, so the #99 bug can't happen there and the tests' tag check failed on Node 20 in CI. Keep the check on Node 22+, where it guards against the tests silently passing, and run the rest of each test everywhere. Also say in the changelog when the query is there: Node 22+ for a module imported while a mock existed, or a loader that adds one.
Member
Author
|
testdouble.js integration failures are here for the same reason as #129 (comment). They'll be fixed when testdouble.js is upgraded to the new quibble. |
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.
Fixes #99
quibble.esm() and quibble.esmImportWithPath() compared raw ESM stack-frame URLs against the ignore list. A wrapper imported while a mock existed has a
?__quibble=NURL, so it was never skipped and specifiers resolved from the wrapper's directory instead of its caller's.Drop the query and hash from file: stack-frame URLs, as fileURLToPath() already does for path-mode callers. Also let ignoreCallsFromThisFile() take a file: URL such as import.meta.url, which the first change would otherwise stop matching.