-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
TypeError: (msg || "").replace is not a function #2168
Comments
I have tried switching to PhantomJS, exact same error. |
Not so sure it is a Karma (config) issue though, because this works:
|
In my case, I was doing stuff outside of a |
I am sorry but this is still not working and needs sorting, either this is a problem with Karma or with Coverage or Both. I will need a viable solution to this 😒 additionally I am building with SystemJS as module loader as this is the recommended way as per the Angular team. |
I also am encountering this problem, also doing test loading via SystemJS |
Also having this issue, test loading via systemjs as well. angular 2 typescript. however with mine, didnt seem to matter if anything was outside the describe blocks. |
not sure if this is a fix for everyone, but we added "reflect-metadata": "0.1.2" as a package for node and it fixed it for us. |
I'm encountering the same in an Angular 2 CLI project. I first get the |
I'm going to close this issue as this is a user problem - it should be noted that there is a starter with coverage all set up properly with https://github.com/preboot/angular2-webpack, primarily maintained by one of the developers on the Angular docs team, so clearly coverage works fine with karma and Angular 2, once one knows all of the important aspects about how Angular 2 works. |
Can someone explain to me what I am doing wrong with the karma coverage. I am currently developing an angular 2 (RC1) service in typescript and want to not only run unit tests on it but also provide code coverage reports. If running the tests without the coverage reporter all is good and the tests are run. Unfortunately, when I include the coverage reporter karma bails with the following error...
10 06 2016 10:45:49.583:DEBUG [web-server]: serving (cached): D:/Git/@my-namespace/my-service/node_modules/rxjs/scheduler/FutureAction.js
Missing error handler on
socket
.TypeError: (msg || "").replace is not a function
at D:\Git@my-namespace\my-service\node_modules\karma\lib\reporter.js:45:23
What I am doing is building typescript into a folder called dist and then exposing this to karma test and coverage
details are below...
... any ideas...?
Expected behavior
karma should run tests and create a coverage file
Actual behavior
10 06 2016 10:45:49.583:DEBUG [web-server]: serving (cached): D:/Git/@my-namespace/my-service/node_modules/rxjs/scheduler/FutureAction.js
Missing error handler on
socket
.TypeError: (msg || "").replace is not a function
at D:\Git@my-namespace\my-service\node_modules\karma\lib\reporter.js:45:23
Enviroment Details
Typescript: 1.8.10
Karma version: 0.13.22
Karma coverage: 0.5.5
karma.config.js
The text was updated successfully, but these errors were encountered: