You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regex for attaching source locations in lib/reporter.js#L25 fails to match absolute Windows path.
The problem is that the regular expression matches drive letters in path such as C:/foo,js as as the path name. This leads to the stack trace below not being rewritten.
Error: intentional
at http://localhost:9876/absoluteC:/foo.js?da39a3ee5e6b4b0d3255bfef95601890afd80709:17
We could make the used regular expression less restrictive by removing the \\: part from the path segment to fix the issue.
var URL_REGEXP = new RegExp('http:\\/\\/[^\\/]*\\/' +
'(base|absolute)' + // prefix
'([^\\?\\s\\]*)' + // path
'(\\?\\w*)?' + // sha
'(\\:(\\d+))?' + // line
'(\\:(\\d+))?' + // column
'', 'g');`
This however this breaks the existing test case.
An additional test case for test/unit/reporter.spec.coffee that must must pass on Windows systems could be the following:
The regex for attaching source locations in lib/reporter.js#L25 fails to match absolute Windows path.
The problem is that the regular expression matches drive letters in path such as
C:/foo,js
as as the path name. This leads to the stack trace below not being rewritten.We could make the used regular expression less restrictive by removing the
\\:
part from the path segment to fix the issue.This however this breaks the existing test case.
An additional test case for test/unit/reporter.spec.coffee that must must pass on Windows systems could be the following:
Maybe I am mistaken but I believe a simple regex fix will not solve the issue across all platforms.
Give me the OK to rewrite the URL matching with some more sophisticated logic and I am happy to provide a pull request.
The text was updated successfully, but these errors were encountered: