-
Notifications
You must be signed in to change notification settings - Fork 135
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
Karma crash after updating code #77
Comments
Interesting, thanks for raising. I'm going to be merging some fairly major changes in over the next few days, I'll leave this open until after that is done and test it then. |
It looks like he deletes all tests and not created it again. so it does no tests anymore |
Can you pull latest and see if you can replicate? |
@lathonez this what I get now after following the README: Mac-mini:clicker martijnbakker$ npm run karma
> clicker@1.0.0 karma /Users/martijnbakker/projects/clicker
> gulp --gulpfile test/gulpfile.ts --cwd ./ karma-debug
[15:26:51] Requiring external module ts-node/register
[15:27:12] sourced Ionic's gulpfile @ /Users/martijnbakker/projects/clicker/gulpfile.js
[15:27:12] Using gulpfile ~/projects/clicker/test/gulpfile.ts
[15:27:12] Starting 'karma-debug'...
20 04 2016 15:27:16.443:WARN [karma]: No captured browser, open http://localhost:9876/
20 04 2016 15:27:16.455:WARN [karma]: Port 9876 in use
20 04 2016 15:27:16.456:INFO [karma]: Karma v0.13.22 server started at http://localhost:9877/
20 04 2016 15:27:16.479:INFO [launcher]: Starting browser Chrome
20 04 2016 15:27:19.338:INFO [Chrome 49.0.2623 (Mac OS X 10.11.2)]: Connected on socket /#cx6D1DKAh8uBev-aAAAA with id 12901630
START:
ClickerApp
✔ initialises with two possible pages
✔ initialises with a root page
✔ initialises with an app
✔ opens a page
ERROR: 'EXCEPTION: Failed to load build/app.html'
ERROR: 'EXCEPTION: Error: Uncaught (in promise): Failed to load build/app.html'
ERROR: 'STACKTRACE:'
ERROR: 'Error: Uncaught (in promise): Failed to load build/app.html
at resolvePromise (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:543:32)
at http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:579:18
at ZoneDelegate.invokeTask (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:365:38)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (http://localhost:9877/base/www/build/test/test.bundle.js?0d9bd470922e5c740bb28c70abb661451d98577f:9:1792460)
at ZoneDelegate.invokeTask (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:364:43)
at Zone.runTask (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:263:48)
at drainMicroTaskQueue (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:482:36)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:9877/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:434:22)'
ERROR: 'Unhandled Promise rejection:', 'Failed to load build/app.html', '; Zone:', 'angular', '; Task:', 'Promise.then', '; Value:', 'Failed to load build/app.html'
ERROR: Error{rejection: 'Failed to load build/app.html', promise: ZoneAwarePromise{__zone_symbol__state: 0, __zone_symbol__value: 'Failed to load build/app.html'}, zone: Zone{_properties: Object{isAngularZone: ...}, _parent: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, _name: 'angular', _zoneDelegate: ZoneDelegate{_taskCounts: ..., zone: ..., _parentDelegate: ..., _forkZS: ..., _forkDlgt: ..., _interceptZS: ..., _interceptDlgt: ..., _invokeZS: ..., _invokeDlgt: ..., _handleErrorZS: ..., _handleErrorDlgt: ..., _scheduleTaskZS: ..., _scheduleTaskDlgt: ..., _invokeTaskZS: ..., _invokeTaskDlgt: ..., _cancelTaskZS: ..., _cancelTaskDlgt: ..., _hasTaskZS: ..., _hasTaskDlgt: ...}}, task: ZoneTask{type: 'microTask', zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, source: 'Promise.then', data: Object{__creationTrace__: ...}, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}
ERROR: 'Unhandled Promise rejection:', 'Failed to load build/app.html', '; Zone:', '<root>', '; Task:', 'Promise.then', '; Value:', 'Failed to load build/app.html'
ERROR: Error{rejection: 'Failed to load build/app.html', promise: ZoneAwarePromise{__zone_symbol__state: 0, __zone_symbol__value: 'Failed to load build/app.html'}, zone: Zone{_properties: Object{}, _parent: null, _name: '<root>', _zoneDelegate: ZoneDelegate{_taskCounts: ..., zone: ..., _parentDelegate: ..., _forkZS: ..., _forkDlgt: ..., _interceptZS: ..., _interceptDlgt: ..., _invokeZS: ..., _invokeDlgt: ..., _handleErrorZS: ..., _handleErrorDlgt: ..., _scheduleTaskZS: ..., _scheduleTaskDlgt: ..., _invokeTaskZS: ..., _invokeTaskDlgt: ..., _cancelTaskZS: ..., _cancelTaskDlgt: ..., _hasTaskZS: ..., _hasTaskDlgt: ...}}, task: ZoneTask{type: 'microTask', zone: Zone{_properties: ..., _parent: ..., _name: ..., _zoneDelegate: ...}, source: 'Promise.then', data: undefined, scheduleFn: undefined, cancelFn: null, callback: function () { ... }, invoke: function () { ... }}}
ERROR: 'ERROR - An error has occurred inside a promise!'
ClickerButton
✖ initialises
Chrome 49.0.2623 (Mac OS X 10.11.2) ERROR
Uncaught Failed to load build/components/clickerButton/clickerButton.html
at /Users/martijnbakker/projects/clicker/node_modules/angular2/bundles/angular2-polyfills.js:267
Finished in 0.115 secs / 0.085 secs
SUMMARY:
✔ 4 tests completed
✖ 1 test failed
FAILED TESTS:
ClickerButton
✖ initialises
Chrome 49.0.2623 (Mac OS X 10.11.2)
Expected null not to be null.
at Object.<anonymous> (/Users/martijnbakker/projects/clicker/www/build/test/test.bundle.js:9:12751)
20 04 2016 15:29:02.619:INFO [watcher]: Removed file "/Users/martijnbakker/projects/clicker/www/build/test/test.bundle.js.map".
20 04 2016 15:29:02.630:INFO [watcher]: Removed file "/Users/martijnbakker/projects/clicker/www/build/test/test.bundle.js".
20 04 2016 15:29:02.638:INFO [watcher]: Changed file "/Users/martijnbakker/projects/clicker/www/build/app.html".
====================================================================================================================
START:
20 04 2016 15:29:02.925:INFO [watcher]: Changed file "/Users/martijnbakker/projects/clicker/www/build/components/clickerButton/clickerButton.html".
20 04 2016 15:29:02.929:INFO [watcher]: Changed file "/Users/martijnbakker/projects/clicker/www/build/components/clickerForm/clickerForm.html".
20 04 2016 15:29:03.022:INFO [watcher]: Changed file "/Users/martijnbakker/projects/clicker/www/build/pages/clickerList/clickerList.html".
20 04 2016 15:29:03.024:INFO [watcher]: Changed file "/Users/martijnbakker/projects/clicker/www/build/pages/page2/page2.html".
Finished in 0.005 secs / 0 secs
SUMMARY:
✔ 0 tests completed
====================================================================================================================
START:
Finished in 0.005 secs / 0 secs
SUMMARY:
✔ 0 tests completed
|
I get this same error under certain circumstances too. I ended up leaving all the tests inside the app.ts file commented out and it works ok. I thought it might be related to the need to import es6-shim in the app.ts per the upgrade to beta4 instructions for ionic2. If I do that though, I get all kinds of odd behavior with my pages not updating the views until after click events fire and such. Not sure if this is because I'm using the Rx libs in my project and there is something in conflict or what. |
Thanks both for the feedback. That error is caused by test/app.stub.js not getting patched at build time. Have you followed the migration path at the top of CHANGELOG.md? Paste the full log output please (including building the tests). I get this same error under certain circumstances too. I ended up leaving I thought it might be related to the need to import es6-shim in the app.ts — Reply to this email directly or view it on GitHub |
FYI #79 - I've finally figured out how to remove this horrible app stub, but it needs the latest version of Karma. So when new Karma comes out this will no longer be a thing anyway.. |
Just for clarity this should be working fine atm.. it is here. https://github.com/lathonez/clicker/blob/master/test/gulpfile.ts#L118-L135 |
So, I'm going to close this. If you're facing issues please reopen. |
After I change something in my code while I run
npm run test.watch
andnpm run karma
in 2 different terminals the test shows no tests any more.This is what I do:
npm run test.watch
npm run karma
(First time the test runs perfect)expect(clickerApp['pages'].length).toEqual(3);
The text was updated successfully, but these errors were encountered: