-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] Expect only overrides error stack for built-in matchers #5162
Merged
cpojer
merged 23 commits into
jestjs:master
from
bvaughn:override-error-stack-only-for-internal-matchers
Jan 5, 2018
Merged
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f39d750
Expect only overrides error stack for built-in matchers
bvaughn e7d9bbd
Fixed naggy lint issue
bvaughn 9c10921
Replaced for...of with Object.keys().forEach()
bvaughn eb5d29c
Merged master
bvaughn ea088cf
Removed JestAssertionError export (as it is no longer needed)
bvaughn f2e7335
Added custom matcher test
bvaughn 3e00753
Adjusted custom_matcher test to use prettified, non-absolute stack
bvaughn 9e0cfae
test: refactor integration test
SimenB 31f8e58
update with correct snapshot
SimenB c388a49
test: skip on windows
SimenB 0c5c78c
Clarified comment
bvaughn 5843ab5
Further clarified comment
bvaughn f902b4b
test: fix test for node 6
SimenB bd21922
test: move custom matcher stack to separate file to be able to skip i…
SimenB 3ef09ea
Revert "test: fix test for node 6"
SimenB f88bf07
test: really fix node 6
SimenB ff50df6
Merge branch 'master' into override-error-stack-only-for-internal-mat…
SimenB 2da0eee
docs: add package prefix to changelog
SimenB 6f6dd91
Merge branch 'master' into override-error-stack-only-for-internal-mat…
bvaughn e8ab539
Reverted unrelated Markdown changes that had made their way into the …
bvaughn 7dad466
Replaced '__jestInternal' string attribute with a Symbol
bvaughn 179093c
Merge branch 'master' into override-error-stack-only-for-internal-mat…
bvaughn b8c6bfe
Updated snapshot
bvaughn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,13 @@ export const setState = (state: Object) => { | |
|
||
export const getMatchers = () => global[JEST_MATCHERS_OBJECT].matchers; | ||
|
||
export const setMatchers = (matchers: MatchersObject) => { | ||
export const setMatchers = (matchers: MatchersObject, isInternal: boolean) => { | ||
Object.keys(matchers).forEach(key => { | ||
const matcher = matchers[key]; | ||
Object.defineProperty(matcher, '__jestInternal', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not use a Symbol instead to make this actually secret? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
value: isInternal, | ||
}); | ||
}); | ||
|
||
Object.assign(global[JEST_MATCHERS_OBJECT].matchers, matchers); | ||
}; |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Removed. 😄