-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Checklist
- I have read and agree to the Code of Conduct
- I have searched for related issues and discussions but they did not match this problem.
- I want to contribute a bugfix myself.
Actual behavior
Happened to get unlucky with the stacktrace on a Mocha test, where the cut-off assertion error in the stacktrace ended with (..., which resulted in the error TestMessage trying to open a file that doesn't exist
AssertionError [ERR_ASSERTION]:
<lines removed>
requestAnimationFrame(...
at Context.<anonymous> (tests/render-to-stream.spec.tsx:59:10)
at processTicksAndRejections (node:internal/process/task_queues:105:5)"
the locationRe regex matches (...\n at Context.<anonymous> (tests/render-to-stream.spec.tsx:59:10) and so it tries to open the filepath "file://<redacted>/...%0A%20%20%20%20at%20Context.%3Canonymous%3E%20%28tests/render-to-stream.spec.tsx"
Expected behavior
To only match the last part of the stacktrace, opening tests/render-to-stream.spec.tsx and showing the error in the correct location
Minimal, Reproducible Example
it('should give an error', function () {
throw new Error("(...");
});
Output
[error] Error: Test process exited with code 1 (as expected with a failing test)
Plugin Version Details
Built from latest git commit 0108cbf
VS Code Version Details
Further details
Do stacktrace paths ever include newlines? Changing the regex to
const locationRe = /\(([^\n):]+?):([0-9]+):([0-9]+)\)[ \t]*\r?\n?/g; seems to work for me