-
Couldn't load subscription status.
- Fork 3
fix #207: assign diagnostic to correct test #209
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
Conversation
|
Also contains #208. |
test/e2e/compare.sh
Outdated
|
|
||
| # Function to replace test duration with 0 and remove file paths | ||
| remove_variables() { | ||
| echo "$1" | sed -E 's/\"duration\": [0-9\.]+/\"duration\": 0/g' | sed -E 's/\/.*\/test\//test\//g' |
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.
Note: do not escape "." in a regexp class. The backslash becomes part of the class rather than escaping ".".
|
|
||
| let diagnosticMessage = '' | ||
| const allTests = Object.create(null) | ||
| let currentTest |
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 is a little bit of a hack to hold on to the last test, so that messages that come in without file, line, and column have somewhere to go.
parse-report.js
Outdated
| function lastTestInStack() { | ||
| return testStack.length ? testStack[testStack.length - 1] : null | ||
| function testId(data) { | ||
| return [data.file, data.line, data.column].join('\0') |
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.
Column is included so that tests that are run together in the same line are distinguishable.
|
|
||
| function resetDiagnosticMessage() { | ||
| diagnosticMessage = '' | ||
| function appendDiagnosticMessage(data) { |
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 reordered these when I was going to use lastTestInStack. Can put them back in the previous order if this is confusing.
|
CI is failing. See my comment on the other PR. |
|
Will rebase this on #208 once it lands. |
|
This relies on #212 since the tests won't pass without it. |
Ensure that calls to test.diagnostic are reflected on the correct test. Now captures previously-lost top-level diagnostics as well. Fixes nearform#207.
|
@simoneb rebased on master |
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.
LGTM, thanks a lot for the contribution!
Fixes #207.