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
feat: error log improvements #1202
feat: error log improvements #1202
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
if (s === nearest && nearest) { | ||
const sourceCode = await fs.readFile(fileFromParsedStack(nearest), 'utf-8') | ||
const sourceCode = readFileSync(fileFromParsedStack(nearest), 'utf-8') |
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.
I found a bug where fs.readFile
stalls the terminal, and breaks for of
loop - because of that some stack trace might be missing.
packages/vitest/src/node/core.ts
Outdated
printError(err: unknown) { | ||
return printError(err, this) | ||
printError(err: unknown, fullStack = false) { | ||
return printError(err, fullStack, this) |
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.
I think we should show all stack trace for some errors (like unhandled ones), bacause it's really hard to debug otherwise.
toString on error
Closes: #1132, #884, #1201
Fixes: #1165, #1203