Skip to content
https://angular.io/guide/testing#the-first-karma-test\u003c/a>\r\nDownloaded the 1st-specs.testing.zip and installed node modules and ran the app per the testing documentation and it failed to reproduce even the initial expected behavior.\r\n\r\n## Expected behavior\r\nAs per \u003ca href='https://angular.io/guide/testing#the-first-karma-test'>The first karma test\u003c/a>:\r\n\u003cpre>\u003ccode>\r\n> npm test\r\n...\r\n[0] 1:37:03 PM - Compilation complete. Watching for file changes.\r\n...\r\n[1] Chrome 51.0.2704: Executed 0 of 0 SUCCESS\r\n Chrome 51.0.2704: Executed 1 of 1 SUCCESS\r\nSUCCESS (0.005 secs / 0.005 secs)\r\n\u003c/code>\u003c/pre>\r\n\r\n## Minimal reproduction of the problem with instructions\r\nDownloaded the 1st-specs.testing.zip and \r\n\u003cpre>\u003ccode>\r\n mkdir 1st-spec\r\n cd 1st-spec\r\n \u003c- pasted contents of zip file\r\n npm install\r\n npm test\r\n\u003c/code>\u003c/pre>\r\n\r\nActual behavior:\r\n\u003cpre>\u003ccode>\r\nC:\\Dat\\Nsg\\L\\Web\\Ng\\1st-spec>npm test\r\n\r\n> angular-io-example@1.0.0 pretest C:\\Dat\\Nsg\\L\\Web\\Ng\\1st-spec\r\n> npm run build\r\n\r\n> angular-io-example@1.0.0 build C:\\Dat\\Nsg\\L\\Web\\Ng\\1st-spec\r\n> tsc -p src/\r\n\r\n> angular-io-example@1.0.0 test C:\\Dat\\Nsg\\L\\Web\\Ng\\1st-spec\r\n> concurrently \"npm run build:watch\" \"karma start karma.conf.js\"\r\n\r\n[0]\r\n[0] > angular-io-example@1.0.0 build:watch C:\\Dat\\Nsg\\L\\Web\\Ng\\1st-spec\r\n[0] > tsc -p src/ -w\r\n[0]\r\n[0] 3:27:48 PM - Compilation complete. Watching for file changes.\r\n[0]\r\n[0]\r\n[1] 21 07 2017 15:27:53.586:WARN [watcher]: Pattern \"C:/Dat/Nsg/L/Web/Ng/1st-spec/src/systemjs.config.extras.js\" does not match any file.\r\n[1] 21 07 2017 15:27:53.723:WARN [watcher]: All files matched by \"C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.js\" were excluded or matched by prior matchers.\r\n[1] 21 07 2017 15:27:53.724:WARN [watcher]: All files matched by \"C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.ts\" were excluded or matched by prior matchers.\r\n[1] 21 07 2017 15:27:53.724:WARN [watcher]: All files matched by \"C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.js.map\" were excluded or matched by prior matchers.\r\n[1] 21 07 2017 15:27:54.082:WARN [karma]: No captured browser, open http://localhost:9876/\r\n[1] 21 07 2017 15:27:54.101:WARN [karma]: Port 9876 in use\r\n[1] 21 07 2017 15:27:54.103:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9877/\r\n[1] 21 07 2017 15:27:54.103:INFO [launcher]: Launching browser Chrome with unlimited concurrency\r\n[1] 21 07 2017 15:27:54.147:INFO [launcher]: Starting browser Chrome\r\n[1] 21 07 2017 15:27:56.672:INFO [Chrome 59.0.3071 (Windows 10 0.0.0)]: Connected on socket jUr4WQKut4Ubov7QAAAA with id 80505140\r\n[1] 21 07 2017 15:27:57.490:WARN [web-server]: 404: /base/src/systemjs.config.extras.js\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'Warning: System.import could not load the optional \"systemjs.config.extras.js\". Did you omit it by accident? Continuing without it.'\r\n[1]\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'Warning: System.import could not load the optional \"systemjs.config.extras.js\". Did you omit it by accident? Continuing without it.'\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}\r\n[1]\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR: 'Unhandled Promise rejection:', '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js', '; Zone:', '\u003croot>', '; Task:', 'Promise.then', '; Value:', Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}, '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js'\r\n[1]\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR: 'Unhandled Promise rejection:', '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js', '; Zone:', '\u003croot>', '; Task:', 'Promise.then', '; Value:', Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}, '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js\r\n[1] Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js'\r\n[1] 21 07 2017 15:28:07.537:WARN [Chrome 59.0.3071 (Windows 10 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR\r\n[1] Disconnected, because no message in 10000 ms.\r\n[1]\r\n[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR\r\n[1] Disconnected, because no message in 10000 ms.\r\n[1]\r\n[0] Terminate batch job (Y/N)?\r\n\u003c/code>\u003c/pre>\r\n\r\n## What is the motivation / use case for changing the behavior?\r\nJust a quick check to see what debugging actually looks like.\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 4.2.6\r\n>node --version\r\nv6.11.0\r\n>npm --version\r\n3.10.10\r\n>tsc --version\r\nVersion 2.4.1\r\n\r\nBrowser:\r\n- [X] Chrome (desktop) Version 59.0.3071.115 (Official Build) (64-bit)\r\n \r\nFor Tooling issues:\r\n- Node version: v6.11.0\r\n- Platform: Windows 10 Pro\r\n\r\nOthers:\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/PHuhn","@type":"Person","name":"PHuhn"},"datePublished":"2017-07-21T20:01:07Z","url":"https://github.com/angular/angular/issues/18288"}
Closed

Description

@PHuhn

I'm submitting a...


[x] Bug report  
[x] Documentation issue or request

Current behavior

In the https://angular.io/guide/testing#the-first-karma-test
Downloaded the 1st-specs.testing.zip and installed node modules and ran the app per the testing documentation and it failed to reproduce even the initial expected behavior.

Expected behavior

As per The first karma test:


> npm test
...
[0] 1:37:03 PM - Compilation complete. Watching for file changes.
...
[1] Chrome 51.0.2704: Executed 0 of 0 SUCCESS
    Chrome 51.0.2704: Executed 1 of 1 SUCCESS
SUCCESS (0.005 secs / 0.005 secs)

Minimal reproduction of the problem with instructions

Downloaded the 1st-specs.testing.zip and


  mkdir 1st-spec
  cd 1st-spec
   <- pasted contents of zip file
  npm install
  npm test

Actual behavior:


C:\Dat\Nsg\L\Web\Ng\1st-spec>npm test

> angular-io-example@1.0.0 pretest C:\Dat\Nsg\L\Web\Ng\1st-spec
> npm run build

> angular-io-example@1.0.0 build C:\Dat\Nsg\L\Web\Ng\1st-spec
> tsc -p src/

> angular-io-example@1.0.0 test C:\Dat\Nsg\L\Web\Ng\1st-spec
> concurrently "npm run build:watch" "karma start karma.conf.js"

[0]
[0] > angular-io-example@1.0.0 build:watch C:\Dat\Nsg\L\Web\Ng\1st-spec
[0] > tsc -p src/ -w
[0]
[0] 3:27:48 PM - Compilation complete. Watching for file changes.
[0]
[0]
[1] 21 07 2017 15:27:53.586:WARN [watcher]: Pattern "C:/Dat/Nsg/L/Web/Ng/1st-spec/src/systemjs.config.extras.js" does not match any file.
[1] 21 07 2017 15:27:53.723:WARN [watcher]: All files matched by "C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.js" were excluded or matched by prior matchers.
[1] 21 07 2017 15:27:53.724:WARN [watcher]: All files matched by "C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.ts" were excluded or matched by prior matchers.
[1] 21 07 2017 15:27:53.724:WARN [watcher]: All files matched by "C:/Dat/Nsg/L/Web/Ng/1st-spec/src/testing/**/*.js.map" were excluded or matched by prior matchers.
[1] 21 07 2017 15:27:54.082:WARN [karma]: No captured browser, open http://localhost:9876/
[1] 21 07 2017 15:27:54.101:WARN [karma]: Port 9876 in use
[1] 21 07 2017 15:27:54.103:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9877/
[1] 21 07 2017 15:27:54.103:INFO [launcher]: Launching browser Chrome with unlimited concurrency
[1] 21 07 2017 15:27:54.147:INFO [launcher]: Starting browser Chrome
[1] 21 07 2017 15:27:56.672:INFO [Chrome 59.0.3071 (Windows 10 0.0.0)]: Connected on socket jUr4WQKut4Ubov7QAAAA with id 80505140
[1] 21 07 2017 15:27:57.490:WARN [web-server]: 404: /base/src/systemjs.config.extras.js
[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.'
[1]
[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: 'Warning: System.import could not load the optional "systemjs.config.extras.js". Did you omit it by accident? Continuing without it.'
[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}
[1]
[1] Chrome 59.0.3071 (Windows 10 0.0.0) LOG: Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}
[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR: 'Unhandled Promise rejection:', '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js', '; Zone:', '', '; Task:', 'Promise.then', '; Value:', Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}, '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js'
[1]
[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR: 'Unhandled Promise rejection:', '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js', '; Zone:', '', '; Task:', 'Promise.then', '; Value:', Error{originalErr: Error{__zone_symbol__currentTask: ZoneTask{_zone: ..., runCount: ..., _zoneDelegates: ..., _state: ..., type: ..., source: ..., data: ..., scheduleFn: ..., cancelFn: ..., callback: ..., invoke: ...}}, __zone_symbol__currentTask: ZoneTask{_zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, runCount: 0, _zoneDelegates: null, _state: 'notScheduled', type: 'microTask', source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}, '(SystemJS) XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error: XHR error (404 Not Found) loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js
[1]     Error loading http://localhost:9877/base/src/node_modules/@angular/core/bundles/core-testing.umd.js'
[1] 21 07 2017 15:28:07.537:WARN [Chrome 59.0.3071 (Windows 10 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR
[1]   Disconnected, because no message in 10000 ms.
[1]
[1] Chrome 59.0.3071 (Windows 10 0.0.0) ERROR
[1]   Disconnected, because no message in 10000 ms.
[1]
[0] Terminate batch job (Y/N)?

What is the motivation / use case for changing the behavior?

Just a quick check to see what debugging actually looks like.

Environment


Angular version: 4.2.6
>node --version
v6.11.0
>npm --version
3.10.10
>tsc --version
Version 2.4.1

Browser:
- [X] Chrome (desktop) Version 59.0.3071.115 (Official Build) (64-bit)
 
For Tooling issues:
- Node version: v6.11.0
- Platform:  Windows 10 Pro

Others:

Activity

  1. petebacondarwin commented on Sep 4, 2017

    @petebacondarwin
    Contributor

    Any thoughts on this @Foxandxss

  2. Foxandxss commented on Sep 4, 2017

    @Foxandxss
    Member

    I will revamp this testing chapter for CLI soon, so I will double check when that happens.

    In any case, the test actually runs, it just popups a lot of warnings and errors.

  3. kapunahelewong commented on Feb 5, 2018

    @kapunahelewong
    Contributor

    Hey @PHuhn, is this still an issue for you?

  4. PHuhn commented on Feb 6, 2018

    @PHuhn
    Author

    Hey:
    I tried to download the 1st-specs.testing.zip this morning, but was unable to find it. I do not remember, if it was on angular.io or github.

  5. kapunahelewong commented on Feb 6, 2018

    @kapunahelewong
    Contributor
  6. gkalpak commented on Feb 6, 2018

    @gkalpak
    Member

    FYI, there is new/improved testing guide in #20697. You can find the latest preview here.

  7. PHuhn commented on Feb 6, 2018

    @PHuhn
    Author

    Kapunahele it was literally 1st-specs.testing.zip, so it is not any of those downloads. I also checked the testing.spec.zip

  8. added this to the needsTriage milestone on Feb 28, 2018
  9. added
    area: testingIssues related to Angular testing features, such as TestBed
    on Jun 4, 2018
  10. jenniferfell commented on Jun 4, 2018

    @jenniferfell
    Contributor

    It looks like this was resolved. Closing. Thanks.

  11. angular-automatic-lock-bot commented on Sep 13, 2019

    @angular-automatic-lock-bot

    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.

  12. locked and limited conversation to collaborators on Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions