-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
Versions
Angular CLI: 1.6.8
Node: 8.2.0
OS: win32 x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0
Repro steps
- Create a new project with
ng new myproject
- Run into the project directory and execute tests with
ng test
. All tests run successfully. - Edit the
src/test.ts
file and just move the lineimport 'zone.js/dist/zone-testing';
to be the last import. - Execute the tests again.
Observed behavior
All tests are failed with this error :
TypeError: Cannot read property 'assertPresent' of undefined
at resetFakeAsyncZone C:/work/intellij-workspace.d/angular/newcli1.6.8/node_modules/@angular/core/esm5/testing.js:367:1)
at UserContext.<anonymous> C:/work/intellij-workspace.d/angular/newcli1.6.8/node_modules/@angular/core/esm5/testing.js:1254:1)
at ZoneQueueRunner.webpackJsonp.../../../../zone.js/dist/zone-testing.js.jasmine.QueueRunner.ZoneQueueRunner.execute C:/work/intellij-workspace.d/angular/newcli1.6.8/node_modules/zone.js/dist/zone-testing.js:437:1)
Chrome 64.0.3282 (Windows 10.0.0): Executed 1 of 3 (1 FAILED) (0 secs / 0.103 secs)
Chrome 64.0.3282 (Windows 10.0.0) AppComponent should create the app FAILED
TypeError: Cannot read property 'assertPresent' of undefined
at resetFakeAsyncZone C:/work/intellij-workspace.d/angular/newcli1.6.8/node_modules/@angular/core/esm5/testing.js:367:1)
at UserContext.<anonymous> C:/work/intellij-workspace.d/angular/newcli1.6.8/node_modules/@angular/core/esm5/testing.js:1254:1)
at ZoneQueueRunner.webpackJsonp.../../../../zone.js/dist/zone-testing.js.jasmine.QueueRunner.ZoneQueueRunner
Desired behavior
All tests would run successfully. In fact, I had this error just because WebStorm automatically reorganized imports. So the zone.js
import was moved after the @angular
ones.
Is this behavior normal?
IntegerMan, orentrutner, fityocsaba96, Smileydude and Tungsten78