-
-
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
fix: improve error on module not found #8704
fix: improve error on module not found #8704
Conversation
@@ -52,6 +52,9 @@ class NodeEnvironment implements JestEnvironment { | |||
global.TextDecoder = TextDecoder; | |||
} | |||
installCommonGlobals(global, config.globals); | |||
// Node's error-message stack size is limited at 10, but it's pretty useful |
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.
to match jsdom
env
packages/jest-runner/src/runTest.ts
Outdated
@@ -84,6 +84,9 @@ async function runTestInternal( | |||
resolver: Resolver, | |||
context?: TestRunnerContext, | |||
): Promise<RunTestInternalResult> { | |||
// Node's error-message stack size is limited at 10, but it's pretty useful | |||
// to see more than that when a test fails. | |||
Error.stackTraceLimit = 100; |
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.
when the error happens outside the test sandbox (such as when resolving a dependency in jest-runtime
)
|
||
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:259:17) | ||
at Object.<anonymous> (node_modules/discord.js/src/index.js:21:12) | ||
at Object.require (test.js:3:1) |
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.
this line is about 15 lines into the stack, which is why it wasn't included before (and we were missing the code frame)
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.
Add a changelog? :D
6d986a6
to
9b4cbac
Compare
I have no idea why there's more open handles with this change :( |
Maybe |
I wonder if the change to stack limit means old frames aren't gc-ed. Can we change the length and trigger a gc before checking for handles? maybe... |
29a90d2
to
dae11e5
Compare
6a4f9c3
to
70f9077
Compare
1d5b8c0
to
e5d4d10
Compare
edb669d
to
6b1d2ba
Compare
83ad129
to
e81cfaf
Compare
e81cfaf
to
f1dc432
Compare
f1dc432
to
3d1d24a
Compare
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
3d1d24a
to
2a1a8ba
Compare
Oldie! 😀 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Before
After
Test plan
E2E test added