Skip to content
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

File paths in output need http:// prefix to match URL_REGEXP in karma/lib/reporter.js #137

Closed
brianmhunt opened this issue Jul 15, 2015 · 9 comments

Comments

@brianmhunt
Copy link

The files output by karma-browserify seem to not match the general reporter regular expression for formatting errors, and so source maps are not exposed.

I am not sure if it is easier for karma-browserify to add the http:// to the beginning of the path in the error messages, or for karma-runner/karma to update the regular expression – so I am cross-posting this issue with karma-runner/karma#1495

@nikku
Copy link
Owner

nikku commented Jul 16, 2015

We receive a number of errors with source maps lately. It seems as if karma + karma-browserify + browserify can sometimes exchange the source map and sometimes not.

@brianmhunt
Copy link
Author

@nikku Thanks.

Just for the sake of completeness, I tried all the seemingly reasonable permutations of commondir and fullPaths, but they changed nothing.

By the time they get to createErrorFormatter:39 in karma/lib/reporter.js they errors spit out are all something like:

AssertionError: expected 'x' to equal 'y'
at Context. (absolute/var/folders/vl/_5jh_5_n3njb7rfcg5tr87p80000gn/T/7b875eecd57ed38e48b76b5fd3aa873f.browserify?07c629ce4f57a079e0139149a80eecf99972dca6:29293:19)

whereas the url should (according to the URL_REGEXP) be something like:

**http://localhost:9876/**absolute/var/folders/vl/_5jh_5_n3njb7rfcg5tr87p80000gn/T/7b875eecd57ed38e48b76b5fd3aa873f.browserify?07c629ce4f57a079e0139149a80eecf99972dca6:29293:19

@nikku
Copy link
Owner

nikku commented Jul 20, 2015

I actually think this is a browser issue.

Running against PhantomJS stack traces would properly be prefixed with http://localhost:9876/absolute/.... Running a test suite against Chrome would result in stack trace entries like absolute/....

See if you can reproduce this behavior.

@brianmhunt
Copy link
Author

Thanks @nikku – I cannot speak for PhantomJS or Safari or IE with these tests, offhand, but the problem appears to exhibit in Firefox as well i.e. the error pinpoints are reported as something like

/var/folders/8v/ntgprb8d3bq58y8ffw4k01kc0000gn/T/470335fca4dc3aa7ab541b4d0d1c680e.browserify:17298:5

i.e. lacking http://.../

Will see if I can put together a minimal test case.

@brianmhunt
Copy link
Author

Here's a minimum working example that should run in multiple platforms https://gist.github.com/brianmhunt/e9b54d35af5c6537e3c8


Note that PhantomJS also exhibits the problem, e.g.

PhantomJS 1.9.8 (Mac OS X 0.0.0) test fails FAILED
AssertionError: expected 'The line is' to equal '7?'
at boo (base/dest.js?fcd0dfb7db26b4b84588fd775d46060de738a534:18)
at base/dest.js?fcd0dfb7db26b4b84588fd775d46060de738a534:27

@nikku
Copy link
Owner

nikku commented Jul 23, 2015

All right. I presume we should wait for some time to let these browsers (or karma) come up with respective fixes. The only thing we do is parsing the source map an providing it to karma.

@brianmhunt
Copy link
Author

Ok, thanks @nikku – the issue is not here by the looks of it. I'll note the MWE on the Karma issue.

@nikku
Copy link
Owner

nikku commented Aug 17, 2015

Seems to be fixed in karma@0.13

@nikku nikku closed this as completed Aug 17, 2015
@brianmhunt
Copy link
Author

Thanks @nikku- yes you are right- we fixed up the regex in karma reporter, sorry for not updating this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants