-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
test: migrate message util tests from Python to JS #49721 #50333
Open
jahjahLemonade
wants to merge
8
commits into
nodejs:main
Choose a base branch
from
jahjahLemonade:jl-test-message-util
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d542f8e
test: migrate message util tests from Python to JS
jahjahLemonade 068e098
moved message files to fixture folder
jahjahLemonade 985dfc5
Run make lint
jahjahLemonade f5489c1
Added Error.stackTraceLimit
jahjahLemonade eae8b32
Rebasing Code
jahjahLemonade bdb6a39
Added additional regex into file
jahjahLemonade e399adb
Updated test-node-output-util.mjs
jahjahLemonade 93e0aca
Update test/parallel/test-node-output-util.mjs
jahjahLemonade 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
2 changes: 1 addition & 1 deletion
2
test/message/util-inspect-error-cause.js → ...fixtures/util/util-inspect-error-cause.js
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
require('../../common'); | ||
|
||
const { inspect } = require('util'); | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,181 @@ | ||
Error: Number error cause | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * { | ||
[cause]: * | ||
} | ||
Error: Object cause | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * { | ||
[cause]: { | ||
message: 'Unique', | ||
name: 'Error', | ||
stack: 'Error: Unique\n' + | ||
' at Module._compile (node:internal*modules*cjs*loader:*:*)' | ||
} | ||
} | ||
Error: undefined cause | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * { | ||
[cause]: undefined | ||
} | ||
Error: cause that throws | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * { | ||
[cause]: [Getter] | ||
} | ||
RangeError: New Stack Frames | ||
at * | ||
*[*m at *[*m { | ||
[cause]: FoobarError: Individual message | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m ... * lines matching cause stack trace ...*[*m | ||
*[*m at *[*m { | ||
status: *[*m'Feeling good'*[*m, | ||
extraProperties: *[*m'Yes!'*[*m, | ||
[cause]: TypeError: Inner error | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._extensions..js (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module.load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:*:*)*[*m | ||
*[*m at *[*m | ||
} | ||
} | ||
Error: Stack causes | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m ... * lines matching cause stack trace ...*[*m | ||
*[*m at *[*m { | ||
[cause]: FoobarError: Individual message | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m ... * lines matching cause stack trace ...*[*m | ||
*[*m at *[*m { | ||
status: *[*m'Feeling good'*[*m, | ||
extraProperties: *[*m'Yes!'*[*m, | ||
[cause]: TypeError: Inner error | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._extensions..js (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module.load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:*:*)*[*m | ||
*[*m at *[*m | ||
} | ||
} | ||
RangeError: New Stack Frames | ||
at * | ||
*[*m at *[*m { | ||
[cause]: Error: Stack causes | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m ... * lines matching cause stack trace ...*[*m | ||
*[*m at *[*m { | ||
[cause]: FoobarError: Individual message | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m ... * lines matching cause stack trace ...*[*m | ||
*[*m at *[*m { | ||
status: *[*m'Feeling good'*[*m, | ||
extraProperties: *[*m'Yes!'*[*m, | ||
[cause]: TypeError: Inner error | ||
at Object.<anonymous> *[*m(**[*mtest*fixtures*util*util-inspect-error-cause.js:*:**[*m)*[*m | ||
*[*m at Module._compile (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._extensions..js (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module.load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Module._load (node:internal*modules*cjs*loader:*:*)*[*m | ||
*[*m at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:*:*)*[*m | ||
*[*m at *[*m | ||
} | ||
} | ||
} | ||
RangeError: New Stack Frames | ||
at * | ||
at * { | ||
[cause]: FoobarError: Individual message | ||
at * | ||
at * | ||
... * lines matching cause stack trace ... | ||
at * { | ||
status: 'Feeling good', | ||
extraProperties: 'Yes!', | ||
[cause]: TypeError: Inner error | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
} | ||
} | ||
Error: Stack causes | ||
at * | ||
at * | ||
... * lines matching cause stack trace ... | ||
at * { | ||
[cause]: FoobarError: Individual message | ||
at * | ||
at * | ||
... * lines matching cause stack trace ... | ||
at * { | ||
status: 'Feeling good', | ||
extraProperties: 'Yes!', | ||
[cause]: TypeError: Inner error | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
} | ||
} | ||
RangeError: New Stack Frames | ||
at * | ||
at * { | ||
[cause]: Error: Stack causes | ||
at * | ||
at * | ||
... * lines matching cause stack trace ... | ||
at * { | ||
[cause]: FoobarError: Individual message | ||
at * | ||
at * | ||
... * lines matching cause stack trace ... | ||
at * { | ||
status: 'Feeling good', | ||
extraProperties: 'Yes!', | ||
[cause]: TypeError: Inner error | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
at * | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
test/message/util_inspect_error.js → test/fixtures/util/util_inspect_error.js
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
Oops, something went wrong.
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.
None of these functions should be in the stack trace. I should be able to refactor the internals of the CommonJS loader without breaking unrelated tests.