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

ng test not working after upgrade to 6.0.0 #10485

Closed
DominicBoettger opened this issue Apr 27, 2018 · 42 comments
Closed

ng test not working after upgrade to 6.0.0 #10485

DominicBoettger opened this issue Apr 27, 2018 · 42 comments

Comments

@DominicBoettger
Copy link

DominicBoettger commented Apr 27, 2018

After upgrading the cli the unit tests doesn't start anymore.
Previous behaviour was that the unit tests were found and executed. Now it does not find the unit tests and says 0 of 0 executed.

Versions

Angular CLI: 6.0.0-rc.6
Node: 9.7.1
OS: win32 x64
Angular: 5.2.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Repro steps

  1. Upgrade to latest cli
  2. ng test

Observed behavior

27 04 2018 14:59:35.185:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
27 04 2018 14:59:35.191:INFO [launcher]: Launching browser Chrome with unlimited concurrency
27 04 2018 14:59:35.201:INFO [launcher]: Starting browser Chrome                                                                                                                                                                                                                      27 04 2018 15:00:26.221:INFO [Chrome 66.0.3359 (Windows 10 0.0.0)]: Connected on socket _q17vZKEaK6MoqgCAAAA with id 70169079
Chrome 66.0.3359 (Windows 10 0.0.0): Executed 0 of 0 ERROR (0.016 secs / 0 secs)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproj-web@0.0.1 test: `ng test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproj-web@0.0.1 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myuser\AppData\Roaming\npm-cache\_logs\2018-04-27T13_00_28_789Z-debug.log
10 silly lifecycle myproj-web@0.0.1~test: Args: [ '/d /s /c', 'ng test' ]
11 silly lifecycle myproj-web@0.0.1~test: Returned: code: 1  signal: null
12 info lifecycle myproj-web@0.0.1~test: Failed to exec test script
13 verbose stack Error: myproj-web@0.0.1 test: `ng test`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at EventEmitter.emit (events.js:127:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:127:13)
13 verbose stack     at maybeClose (internal/child_process.js:936:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid myproj-web@0.0.1
15 verbose cwd C:\Users\myuser\myproj\myproj-web
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
18 verbose node v9.7.1
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error myproj-web@0.0.1 test: `ng test`
22 error Exit status 1
23 error Failed at the myproj-web@0.0.1 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@DominicBoettger
Copy link
Author

.angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "myproj-web": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              },
              {
                "glob": "**/*",
                "input": "src/favicon.ico",
                "output": "/favicon.ico"
              }
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "localdev": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.localdev.ts"
                }
              ]
            },
            "localdev-other": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.localdev-other.ts"
                }
              ]
            },
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "serviceWorker": false,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            },
            "demo": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.demo.ts"
                }
              ]
            },
            "demo-other": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.demo-six.ts"
                }
              ]
            },
            "e2e-tests": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.e2e-tests.ts"
                }
              ]
            },
            "preview": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "serviceWorker": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.preview.ts"
                }
              ]
            },
            "dev-other": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.dev-other.ts"
                }
              ]
            },
            "prod-other": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "serviceWorker": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod-other.ts"
                }
              ]
            },
            "preview-other": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.preview-other.ts"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "myproj-web:build"
          },
          "configurations": {
            "localdev": {
              "browserTarget": "myproj-web:build:localdev"
            },
            "localdev-other": {
              "browserTarget": "myproj-web:build:localdev-other"
            },
            "production": {
              "browserTarget": "myproj-web:build:production"
            },
            "demo": {
              "browserTarget": "myproj-web:build:demo"
            },
            "demo-other": {
              "browserTarget": "myproj-web:build:demo-other"
            },
            "e2e-tests": {
              "browserTarget": "myproj-web:build:e2e-tests"
            },
            "preview": {
              "browserTarget": "myproj-web:build:preview"
            },
            "dev-other": {
              "browserTarget": "myproj-web:build:dev-other"
            },
            "prod-other": {
              "browserTarget": "myproj-web:build:prod-other"
            },
            "preview-other": {
              "browserTarget": "myproj-web:build:preview-other"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "myproj-web:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "karmaConfig": "src/karma.conf.js",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "scripts": [],
            "styles": [
              "src/styles.scss"
            ],
            "assets": [
              {
                "glob": "**/*",
                "input": "src/assets",
                "output": "/assets"
              },
              {
                "glob": "**/*",
                "input": "src/favicon.ico",
                "output": "/favicon.ico"
              }
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "myproj-web-e2e": {
      "root": "",
      "projectType": "application",
      "cli": {},
      "schematics": {},
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "./protractor.conf.js",
            "devServerTarget": "myproj-web:serve"
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "e2e/tsconfig.e2e.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "cli": {},
  "schematics": {
    "@schematics/angular:component": {
      "prefix": "app",
      "styleext": "scss"
    },
    "@schematics/angular:directive": {
      "prefix": "app"
    }
  }
}

@sandangel
Copy link

fixed after rc.8, but ng new still not work.

@DominicBoettger
Copy link
Author

Also tried

Angular CLI: 6.0.0-rc.8
Node: 9.11.1
OS: win32 x64
Angular: 6.0.0-rc.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.11
@angular-devkit/build-angular     0.5.11
@angular-devkit/build-optimizer   0.5.11
@angular-devkit/core              0.5.11
@angular-devkit/schematics        0.5.11
@angular/cdk                      5.2.5
@angular/cli                      6.0.0-rc.8
@angular/material                 5.2.5
@ngtools/webpack                  6.0.0-rc.9
@schematics/angular               0.5.11
@schematics/update                0.5.11
rxjs                              6.0.0
typescript                        2.7.2
webpack                           4.6.0

@DominicBoettger
Copy link
Author

I also tried to replace, karma, tsconfigs, edited angular.json, replaced angular.json with one from a new project........

@pshields
Copy link

pshields commented May 4, 2018

I'm running into a similar issue on @angular/cli 6.0.0. For me, the error line looks like Chrome 66.0.3359 (Linux 0.0.0): Executed 0 of 0 ERROR (0.009 secs / 0 secs). Similar to @DominicBoettger, the previous behavior for my project was that the tests were found and executed successfully. I'm having trouble troubleshooting this; no errors appear in my Chrome console when running the tests, and changing the Karma log level to DEBUG doesn't show any obvious issues. I tried futzing around with the dependency versions of Karma and Jasmine, thinking maybe I had upgraded them to incompatible versions, but that did not yield any solutions either. I've looked at the source changes made to my files as part of upgrading to Angular v6, but haven't been able to identify any leads. Also, I'm not even seeing the npm ERR! messages that @DominicBoettger posted. The Executed 0 of 0 ERROR (0.009 secs / 0 secs) is the last line of the output for me before ng test finishes.

@pshields
Copy link

pshields commented May 4, 2018

I've done some more investigation. My Karma entrypoint file (which I had renamed from src/test.ts to ui/main.karma.ts; all of my .ts files live in ui rather than src) does not seem to be getting executed in the way I'd expect: none of the console.error statements I place in that file ever show up in the console or terminal output (they do show up in the terminal output if I do the same thing in a clean ng new project.)

I confirmed that my main.karma.ts file is correctly referenced from the angular.json test/main option, and I confirmed that compilation fails if I change the "main" attribute to point to a nonexistent filename.

I confirmed that my *.spec.ts files are detected and included by Karma. The generated _karma_webpack_/main.js file available when running Karma contains a var map = {...} line section which maps my spec files to their workspace-relative paths, and the tests themselves show up in that file.

My suspicion is still that something is going wrong with the execution of my Karma main entrypoint file, since like I mentioned, any console.error or other logging statements I add to that file are not showing up in my terminal output. However, that file is very simple and is identical to the test.ts provided out-of-the-box by Angular CLI, so I'm still not sure what the issue is.

@crh225
Copy link

crh225 commented May 6, 2018

I got this same issue when using ng upgrade when upgrading to angular 6 on a cli project.

@herkulano
Copy link

I have the same issue. I've managed to get it to work simply by removing and adding the tests again. It worked without changing any configuration. In my case, I've pinpointed the tests down to 3, as soon as I turn any of them on again it throws the dreaded Executed 0 of 0 ERROR.

My guess is that there's some problem in the CLI that it doesn't surface errors and fails silently.

@kucharzyk
Copy link

I've got the same problem. Karma is running but no tests are executed.

It looks like test.ts is not loaded

@herkulano
Copy link

herkulano commented May 7, 2018

I've managed to reproduce the bug with a clean ng new project.

Steps:

Create a new project

ng new test

Add the modules

npm install firebase angularfire2 rxjs-compat --save

Add this code to the app.component.spec.ts

import { AngularFireAuth } from 'angularfire2/auth';
const af = AngularFireAuth;

Note:

If I run Jest instead of Karma I get the following error:

Zone already loaded.

Version:

Angular CLI: 6.0.0
Node: 10.0.0
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

@herkulano
Copy link

herkulano commented May 7, 2018

Could be related to angular/angularfire#1597

Downgrading firebase and angularfire2 fixes it:

"angularfire2": "5.0.0-rc.6",
"firebase": "~4.12",

@mszalbach
Copy link

mszalbach commented May 7, 2018

In my project all specs which tests components with jquery are affected. When deleting them it works. With angular 5.2 and cli 1.7 they worked. JQuery is defined in polyfills.ts. Still need to find out how to fix them.

The specs not working cause of JQuery could be fixed by not using an import for JQuery:

//import * as $ from 'jquery/dist/jquery';
declare let jQuery: any;

my polyfills.ts looks like this:

import * as $ from 'jquery/dist/jquery';
window['jQuery'] = $;

Only one test left which fails because the component I use seems not to be Angular 6 ready.

@kirstenOtting
Copy link

I just ran into this as well (Executed 0 of 0 ERROR) after upgrading to Angular 6 on a project where tests previously ran successfully. I compared the test.ts file in my project versus a new project generated with the Angular 6 CLI, and noticed a lot of additional imports (import 'core-js/es7/reflect', import 'zone.js/dist/jasmine-patch'), etc in my project. I replaced these with:

import 'zone.js/dist/zone-testing';

and my tests started executing again. It definitely seems like an error message is getting swallowed somewhere.

@kucharzyk
Copy link

I've checked code generated by jasmine.

All specs are present but none of them are loaded.

@bruiztorres
Copy link

I'm facing the same issue mentioned above. It seems test.ts file is never executed

@grantbowering
Copy link

I am experiencing the same issue, and I am ground completely to a halt for the time being :(

@grantbowering
Copy link

Thanks to @herkulano for the mention that Jest ran and gave a real error message; as a workaround I dropped in Jest using a couple of the steps from here, and was able to execute my tests and see one failing and fix it...

Except now all my tests pass with jest, yet are still all "0 of 0 ERROR" with ng test.

¯\(ツ)

@BrandonCravener
Copy link

After upgrading to jest I realized the issue was my version of angular fire 2. I downgraded angular fire to 5.0.0-rc.5-next and it started working again. The main issue is that the error is not being shown to the user.

@bruiztorres
Copy link

Same here, it seems after upgrading some tests were broken so I fixed them with Jest. However, karma is still failing. FYI: I'm not using firebase in my project.

@kucharzyk
Copy link

In my case problem was caused by rxjs.
In polyfills.ts I had imports like 'rxjs/add/operator/map'
I could build and run app without any problem but test won't work.

After removing old operators (and some refactoring to made it work) tests started to work again

@dmfaux
Copy link

dmfaux commented May 16, 2018

I have tried many different options, updated karma.conf, run rxjs-5-to-6-migrate using both tsconfig.app.json and tsconfig.spec.json, limiting the test to only one file using both fdescribe and an updated context all to no avail, still getting the same error with no indication of what might be the issue (I don't have angular fire installed).

10% building modules 1/1 modules 0 active(node:20307)
10% building modules 3/3 modules 0 active16 05 2018
16 05 2018 13:28:48.389:INFO [karma]: Karma v2.0.2 server started at http://0.0.0.0:9876/
16 05 2018 13:28:48.391:INFO [launcher]: Launching browser Chrome with unlimited concurrency
10% building modules 3/4 modules 1 active …Code/app/src sync /\.spec\.ts$/
16 05 2018 13:28:48.397:INFO [launcher]: Starting browser Chrome
16 05 2018 13:29:16.145:INFO [Chrome 66.0.3359 (Mac OS X 10.13.4)]: Connected on socket Oe1qLUQnfzz4NoimAAAA with id 50078300
Chrome 66.0.3359 (Mac OS X 10.13.4): Executed 0 of 0 ERROR (0.012 secs / 0 secs)

Jest does run but requires many tests to be updated in our application which is not at option at the moment.

Any guidance or tips appreciated! 🙏

@trayhem
Copy link

trayhem commented May 16, 2018

I'm also experiencing this problem. ng serve and ng build runs without errors. I've tried to move files like package.json, tsconfig.*.json, test.ts, karma.conf.js, etc. from a clean project to my existing one but without luck.

I've also moved some tests from my existing app to the clean project and with some work they do run without any problems. Before upgrading to Angular 6 all tests were working fine.

Jest is also not an option for our project since almost all tests need to be updated.

I can confirm that the spec files are bundled by webpack and served to karma. However, inspecting the source tab in Chrome shows that there is indeed a part of the application missing.

My App:
bildschirmfoto 2018-05-16 um 15 44 37

Vs. new Project:
bildschirmfoto 2018-05-16 um 15 44 22

@WilliamChelman
Copy link

If that might help, for our configuration it was the presence of rxjs-compat while testing that made everything fail (well, 0 of 0 executed), so in tsconfig.spec.json we added

"compilerOptions": {
        "paths": {
            "rxjs-compat": ["rxjs-compat.mock.ts"],
         }
}

where rxjs-compat.mock.ts is just

console.warn('False rxjs-compat loaded for testing, you should remove this whenever possible');

@dmfaux
Copy link

dmfaux commented May 17, 2018

@WilliamChelman this method did expose an issue with my paths which are defined in tsconfig.json but were not being defined in the tsconfig.spec.json, this was not an issue in Angular 5.x. I have updated tsconfig.spec.json with those now as well:

 "paths": {
      "rxjs-compat": ["rxjs-compat.mock.ts"],
      "@app/*": ["app/*"],
      "@env/*": ["environments/*"]
    }

The only change seems to be an addition of a SUCCESS entry in the output:

Chrome 66.0.3359 (Mac OS X 10.13.4): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
Chrome 66.0.3359 (Mac OS X 10.13.4): Executed 0 of 0 ERROR (0.02 secs / 0 secs)

I am surprised no one from the team have weighed in on this as yet, not even to merely label the issue 😐

@AndriiKobzar
Copy link

In my situation I had one spec file that silently failed the whole test run. After commenting out this spec, I was able to run tests again.

To find the specific test, I ran ls src/**/*.spec.ts | grep -o ".........$" | cut -d. -f1 | sort | uniq to get the previous letter before ".spec.ts" part. Then I added these letters. one by one, to regular expression in test.ts file, like a\.spec\.ts, then (a|b)\.spec\.ts etc. At the beginning, I run more and more tests successfully, until the regex included corrupted test. For me, the last letter added was 'e', so it was either service or pipe specification.

Subsequently, I was able to find autogenerated service test, that caused the error. I am pretty sure, that the error was in beforeEach part, however I can't figure out the exact reason.

Hope my comment helps someone.

@trayhem
Copy link

trayhem commented May 19, 2018

@AndriiKobzar Thanks for your Tip. I've used adjusted it a litte to walk through the components in the test.ts step by step, eg. /(footer.*|header.*)\.spec\.ts$/ until one of the component tests failed. The problem was a missing service injection required by an include of the component.

@DominicBoettger
Copy link
Author

I also did several tests and modifications but still get the message
Chrome 66.0.3359 (Windows 10.0.0): Executed 0 of 0 ERROR (0.009 secs / 0 secs)

If i create a new project it works without any problems. It's just not finding any tests in my existing project.

@Ristaaf
Copy link

Ristaaf commented May 29, 2018

#11011 Just some additional testing, rxjs-compat seems to be the culprit for me too.

@dmfaux
Copy link

dmfaux commented May 29, 2018

As mentioned in #11011 by @L2jLiga, I tried downgrading the @angular/cli to 1.7.4 and the tests are running once more. Might be a short term solution for those in a pinch.

EDIT: I spoke too soon, forgot that I was limiting the spec files targeting in test.ts, 1.7.4 does not work for me.

@graypegg
Copy link

Holy moly this is an incredibly annoying issue.

Using @AndriiKobzar method, came across a totally blank test file that ended in s.spec.ts. Looks like we have no other test that ended with that format, so running ONLY tests from require.context('(s)\.spec\.ts') means I at least end up with it showing console.log statements from test.js. (It's odd how it wouldn't show those BEFORE changing something in the same file containing those console.log statements? Not sure why? Almost like karma only shows console output when the test file completes, and not if it fails?)

Putting:

it('foo', () => {
  expect(true).toBe(true);
});

in the ONE blank test file allows it to run with one successful test. Not sure if this helps anyone, but my current plan is to just start slowly adding to this test till it breaks.

@danigar
Copy link

danigar commented May 30, 2018

My problem was with basePath property of karma.conf file. With @angular/cli - 1.7.4 I had this field empty and after upgrade Angular to version 6 I was experienced the same failing behaviour on tests.
I've filled it in with / and they run 👌 now.

@filipesilva
Copy link
Contributor

I'd like to look at this but really need a repro to investigate. Can someone put up a repro in github please? Then I can clone it and look into the problem.

@herkulano
Copy link

@filipesilva you can do reproduce it with these simple steps:
#10485 (comment)

@filipesilva
Copy link
Contributor

@herkulano thank you for directing me to the repro, will look at it.

@herkulano
Copy link

@filipesilva to make it simpler I've created a repro with the problem: https://github.com/herkulano/ng-cli-issue-10485

@Ristaaf
Copy link

Ristaaf commented May 31, 2018

@filipesilva Also really simple to reproduce like this:

  1. ng new myapp
  2. edit polyfills.ts and add import "zone.js/dist/zone-patch-rxjs";
  3. npm install rxjs-compat
  4. ng test

@filipesilva
Copy link
Contributor

Hey all, thanks for the reports. I think I know what was happening. It was two things together:

  • AngularFire2 was importing zone directly (Error: Zone already loaded. angularfire#1597). This caused the "Zone already loaded." message.
  • the Angular CLI build system was splitting the common parts of polyfills and test but not loading the common bits. This resulted in no error messages and no tests ran.

The first problem was fixed in angular/angularfire#1599 and released in angularfire2@5.0.0-rc.8. The second problem has a fix incoming in angular/devkit#993.

@herkulano I got your repro to work by manually applying the changes in my PR and updating to angularfire2@5.0.0-rc.8.

If you want to try this yourself, open node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/test.js and replace

chunks: buildOptions.commonChunk ? 'all' : 'initial',`

with

chunks: (chunk) => chunk.name !== "polyfills",

@Ristaaf your repro seems to work fine if I add import 'zone.js/dist/zone-patch-rxjs'; after import 'zone.js/dist/zone'; .

@elvirdolic
Copy link

Greak work @filipesilva chunks: (chunk) => chunk.name !== "polyfills" fixed it!! Can't wait for update to update to angular 6 :)

@herkulano
Copy link

herkulano commented May 31, 2018

@filipesilva thank you, but you're missing the point.

The solution is not fixing everyone's code. It's not having silent errors so that we can fix it ourselves.

I already knew this was a problem with AngularFire, but the CLI or Karma gave me no pointers on where or why it was failing. I ended up moving to Jest, which had no problems showing exactly what was going on.

@filipesilva
Copy link
Contributor

@herkulano it gave you no pointers because of the problem I am fixing in angular/devkit#993.

the Angular CLI build system was splitting the common parts of polyfills and test but not loading the common bits. This resulted in no error messages and no tests ran.

@herkulano
Copy link

@filipesilva cool, thank you! didn't understand you were actually fixing the underlying problem.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests