[tests] Add \n in <stack> placeholder for native stacks#35496
Closed
rickhanlonii wants to merge 4 commits intofacebook:mainfrom
Closed
[tests] Add \n in <stack> placeholder for native stacks#35496rickhanlonii wants to merge 4 commits intofacebook:mainfrom
\n in <stack> placeholder for native stacks#35496rickhanlonii wants to merge 4 commits intofacebook:mainfrom
Conversation
Update test assertions to include the complete component stack trace rather than partial stacks. This ensures tests validate the full owner stack as it would appear in development.
|
Comparing: 5aec1b2...f87b7d0 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
Add two new placeholders for console error assertions: 1. [Server] - expands to the ANSI escape sequence for server badge Instead of: '\u001b[0m\u001b[7m Server \u001b[0mError: message' Write: '[Server] Error: message' 2. \n in <stack> - matches JavaScript Error stack traces Instead of matching the full error stack manually Write: 'Error: message\n in <stack>' The error stack placeholder validates that it's only used for actual Error stack traces (messages starting with "Error:" that have file:line:col frames), not for React component stacks. Also adds validation to catch misuse of these placeholders and provides helpful error messages guiding developers to the correct usage.
14ba205 to
f87b7d0
Compare
Member
Author
|
yeah i'm not fucking with a stack on this anymore, merging into #35497 |
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.
Stacked on #35495
Some of the error messages we asset on add a native javascript stack trace, which would be a pain to add to the messages and maintain. This PR allows you to just add
\n in <stack> placeholderto the error message to denote a native stack trace is present in the message.Note: it was a pain to break this into a stack so the actual impl in consoleMock has some unrelated changes. I'd probably just review the tests for this diff and ignore the changes, I plan on simplifying it and cleaning it up in a later PR.