-
Notifications
You must be signed in to change notification settings - Fork 408
0.6.14 Uncaught Error: Missing: SyncTestZoneSpec for Angular RC4 tests #404
Comments
same issue happening for me.. is there any update? |
Downgrading zone.js to |
We get the same error with Angular 2 RC5. We are also using a configuration similar to angular2-webpack-starter, and therefore also automatically got the new zone.js version in our CI builds. |
I did the below changes to the config/karma-test-shim.js (or config/spec-bundle.js) and unit tests worked again. require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
require('zone.js/dist/sync-test');
require('zone.js/dist/proxy-zone'); // since zone.js 0.6.14
require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14 |
yup. that's the right fix. you need to load the sync-test zone in your testing harness. |
We are using Angular2 RC2. The above test shim update did not resolve the issue. I updated - "zone.js": "^0.6.12",
+ "zone.js": "^0.6.14", and updated to include:
These steps did not work. Forcing a downgrade to "dependencies": {
"@angular/compiler": "2.0.0-rc.2",
"@angular/common": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2",
"@angular/http": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/router": "2.0.0-rc.2",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.2",
"@ngrx/core": "^1.0.0",
"@ngrx/store": "^2.0.1",
"core-js": "^2.4.0",
"es6-promise": "^3.2.1",
"es6-shim": "^0.35.1",
"reflect-metadata": "^0.1.3",
"require": "^2.4.20",
"rxjs": "^5.0.0-beta.9",
- "zone.js": "^0.6.12",
+ "zone.js": "0.6.13",
"material-design-lite": "^1.1.3",
"getmdl-select": "^1.0.4"
}, |
@cdcooksey Did you clear out your node modules and rerun npm install? |
* Implement AppGlobals service to store global variables. * Add globalErrors to AppGlobals. * Bind errors to primitive fields components. * Add basic style for errors (red background). * Add tooltip to show error messages (for only primitive-field). Fix inspirehep#59. * Implement errorsToMessagesHtml pipe for tooltip view. * Create abstract-field component to share common functionalities of field components. * Remove abstract-tracker. * Add `x_editor_validation_url` extension. * Add `x_editor_validation_url` to root schema for testing before-save validation. * Add dummy save button that uses `x_editor_validation_url`. * Add mock remote validation response. * Pass exact schema to the editor instead of schema.properties. * Update record-fixer tests. * Upgrade zone to 0.6.13 in order to resolve angular/zone.js#404
Experiencing same issue, downgrading to 0.6.13 as @cdcooksey mentioned did not resolve the issue for me. |
Downgrade zone.js version to fix tests (angular/zone.js#404)
As of 0.6.15, the proxy-zone package has been renamed to proxy. The following imports work for us.
|
@SaltyDH thanks - we found the order of the dependencies was also important... |
Signed-off-by: Sebastian Haas <[email protected]>
…created to address this. Commented test units to correct `error TS2339`; bug angular#467 created to address this.
Fix zone.js issues as discussed in angular/zone.js#404
* feat(FirebaseObjectObservable, FirebaseArrayObservable): Add $ref to observables Makes the firebase.database.Reference used to create the observable public so that it can be used for accessing child records and paths relative to this collection/object. This closes #294 * Locked zone.js to 0.6.12 per bug angular/zone.js#404, bug #468 created to address this. Commented test units to correct `error TS2339`; bug #467 created to address this.
Fixed by updating the 'files' array in karma.config.js with:
NOTE: as indicated by others, the order is important |
Fixes azavea#124. See angular/zone.js#404.
Fixes azavea#124. See angular/zone.js#404.
Just wasted almost an hour on this! The order of imports is indeed important. I use tslint and I've blindly applied the autofix for the "ordered-imports" rule in VS Code (via the TSLint extension), so it sorted them alphabetically. Btw, it would be nice if zone.js fixed this dependency on the order of imports. Easy to overlook, this; and feels like a magic spell, or even like a bug if you ask me, a humble guest in the strange javascript world. |
The sort order I needed for Angular 4.0.0 generated using the CLI was so:
|
@julie-ng In which file did you throw those imports in? |
@RoestVrijStaal I just ran into the same problem. The imports are already in src/test.ts but TSLint changes their order if you have "ordered-imports" enabled. Changing the order back to the order listed above (and disabling TSLint for this file) solved the problem for me. |
I have made a PR #982 to add a new |
* fix(bazel): add zone-testing bundle for bazel build * fix(build): fix #404, add zone-testing to load test related files * fix(build): add zone-testing-node-bundle
Same issue for me, after tslint auto fixed many files in my project the client tests did not work anymore. |
My testbed imports got reordered as well. The complete import list I see for V4.x right now is import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing'; |
Since 0.6.14 I'm getting
Uncaught Error: Missing: SyncTestZoneSpec
for my Angular2 RC4 unit tests. They work with 0.6.13.Affected project and failing build as a reference.
I'm using angular2-webpack-starter for my Angular2 project (like many others) which references zone.js via
~0.6.12
(package.json). This issue is likely affecting a lot of people.The text was updated successfully, but these errors were encountered: