-
Notifications
You must be signed in to change notification settings - Fork 12k
ng test. Karma: Executed 0 of 0 ERROR (0.006 secs / 0 secs) #11011
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
Comments
I have the same problem, after upgrading. Creating a new project with ng new works fine however, but even copying the karma.conf.js, test.ts, angular.json, tsconf.spec.json and relevant parts of package.json from the working project into my upgraded project and even the app.component.spec.ts I still get same behaviour, Executed 0 of 0 ERROR, I really don't get what else could be affecting this! |
Just one more thing I though about, since 6.0 my application does not compile in jit mode anymore, some kind of obscure circular dependency, it works fine in aot though, so that is what I intend to run, but the unit testing cannot be run in aot, correct? So might this be the problem. Not sure how much of the application is actually built for the unit testing, so I cannot say if it bootstraps or not. |
What I tried to fix this problem:
Also one more thing: Wallaby.js can run tests correctly |
Did some debugging, to se if I could understand something, but the only significant find I had was that a breakpoint in test.ts in my converted app is never reached, but in the ng newed app it is, so something is preventing test.ts from being called... |
I found some things that can break tests this way, however I have not been able to get my specific app to work yet. It seems like though, this behavior is really not only one problem, it seems to be a specific kind of issue, where something goes wrong probably when doing some kind of bootstrapping, but ng test does not report that, so it is almost impossible to find out what the actual problem is. So my guess is that when you get Executed 0 of 0 ERROR... it really means that the "testbench app" built by the ng test command, fails to bootstrap, however there is no log anywhere that says why, and the debug tools console is clean too. However this is a simple way of reproducting this problem:
A bit curious also to if this problem is actually connected to rxjs-compat in some way. |
Facing the same issue here. I've spent some time debugging but still have no idea about the source of the problem 😞. |
Try to change the karma.conf
This works perfect for me:
|
We have the same problem. No idea what's wrong no comment from angular-cli team here ... really strange |
Can someone provide me a repro app where this happens? |
@filipesilva see also #10485. Im not able to reproduce with new ng project and ours is private to upload. |
I found solution for my case:
Steps to resolve:
|
same issue here,
Don't know how to solve this :( here is my dependency info
the chrome will start up, but it auto closed after error occur My project updated from Angular 5 -> Angular 6 when Angular 6 release, "Test.ts , typing.spec.config , karma.config.js " are same with "ng new APP" files |
@100cm could you also provide your package.json and polyfills.ts ? |
please update to latest angular-cli version this bug was fixed with 6.0.8
…On 7 June 2018 at 11:41, Andrey Chalkin ***@***.***> wrote:
@100cm <https://github.com/100cm> could you also provide your
package.json and polyfills.ts ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11011 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQ8j8oVlivFiMMZPyXIgRy8E2FPZbEvhks5t6PUsgaJpZM4UNoly>
.
|
i have solved this problem by updating angular-cli to V6.0.8 |
@elvirdolic unfortunately it's still doesn't work for me as it work in CLI 1.7.4: if I add rxjs-compact imports into polyfills.ts. Behaviour on CLI <= 1.7.4: Behaviour on CLI >= 6.0.0 & < 6.0.8 Behaviour on CLI >= 6.0.8 |
you don't need to add rxjs-compact into polyfills and use the latest version 6.0.8 |
This changes was made a long time ago and when I join to project we already have it in polyfills. After migration to Angular 6 we confronted with problem that tests aren't running. |
I'm using |
@Nxt3 could you provide some more information? |
angular.json
tsconfig.app.json
tsconfig.spec.json
test.ts
karma.conf.js
I actually get the error:
but, this works if in a newly generated app. I had it at one point that had the same error that was outlined above--but I'm so deep into this I have no idea what I've done to get here. |
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "apps/federation/src/test.ts",
"polyfills": "apps/federation/src/polyfills.ts",
"tsConfig": "apps/federation/tsconfig.app.json",
"karmaConfig": "apps/federation/karma.conf.js",
"styles": ["apps/federation/src/styles.scss"],
"scripts": [],
"assets": [
"./apps/federation/src/assets",
"./apps/federation/src/favicon.ico",
{
"glob": "**/*",
"input": "libs/translate/locale",
"output": "/libs/locale"
}
]
}
|
@L2jLiga Noooooo I'm so embarrassed. Thanks for pointing out my mistake. |
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version. If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Tests broken after migrating from CLI 1.7.4 -> 6.x.x
Versions
package.json
Karma.conf.js
ng test output
The text was updated successfully, but these errors were encountered: