-
Notifications
You must be signed in to change notification settings - Fork 145
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
--reporter does not work with namespaced modules #199
Comments
Quick side note here: This behavior basicaly occurs when using namespaced node modules. In our {
"scripts": {
"test": "nyc ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json --reporter=@namespace/jasmine-junit-reporter"
}
} The |
Thanks @Kagu-chan . I could take a crack at this myself, but I'm not aware of any publicly available reporters that are in namespaces. (I assume the reporters both of you are using are private, since you've both redacted the names or paths.) It would probably be better if someone who actually has this problem, and can therefore verify a fix, would submit a PR. |
Hi @sgravrock Thanks for the response - yes, we use a private / namespaced module. May it be an option to load the package.json (if we get the data without any problems) and 'whitelist' modules to load them as we normally would? I don't know which implications to performance or stability / false positives this would have though... |
I think @NicoAiko has it right: the problem is that Jasmine incorrectly treats anything with a slash in it as a relative path. If that was fixed so that only import specifiers starting with |
* Fixes #199 * Merges #209 from @jan-molak
Version:
[email protected]
Operating System: Windows 10
This is a similar error to #196 if you ask me.
Likely the root of this problem
Due to
loader.js
in line 16 checking if the modulePath contains a path separator and for/
, it tries to load the module usingfile://
protocol as (our) reporter contains a slash in its module name.Line in question:
if (modulePath.indexOf(path.sep) === -1 && modulePath.indexOf('/') === -1) {
Error message:
Workaround:
Like in #196, it's possible to use
"jsLoader": "require"
, but if possible that shouldn't be necessary.The text was updated successfully, but these errors were encountered: