Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

0.6.14 Uncaught Error: Missing: SyncTestZoneSpec for Angular RC4 tests #404

Closed
binarious opened this issue Aug 17, 2016 · 18 comments · Fixed by #982
Closed

0.6.14 Uncaught Error: Missing: SyncTestZoneSpec for Angular RC4 tests #404

binarious opened this issue Aug 17, 2016 · 18 comments · Fixed by #982

Comments

@binarious
Copy link

binarious commented Aug 17, 2016

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.

@binarious binarious changed the title 0.6.14 Uncaught Error: Missing: SyncTestZoneSpec for Angular tests 0.6.14 Uncaught Error: Missing: SyncTestZoneSpec for Angular RC4 tests Aug 17, 2016
binarious pushed a commit to Sirimangalo/meditation-plus-angular that referenced this issue Aug 17, 2016
@combmag-zz
Copy link

same issue happening for me.. is there any update?

@binarious
Copy link
Author

binarious commented Aug 17, 2016

Downgrading zone.js to 0.6.13 works for me.

@oocx
Copy link

oocx commented Aug 17, 2016

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.

@raelzhu
Copy link

raelzhu commented Aug 17, 2016

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

@IgorMinar
Copy link
Contributor

yup. that's the right fix. you need to load the sync-test zone in your testing harness.

@cdcooksey
Copy link

cdcooksey commented Aug 17, 2016

We are using Angular2 RC2.

The above test shim update did not resolve the issue.

I updated package.json to this:

-    "zone.js": "^0.6.12",
+    "zone.js": "^0.6.14",

and updated to include:

require('zone.js/dist/proxy-zone');
require('zone.js/dist/sync-test');

These steps did not work.

Forcing a downgrade to 0.6.13 resolved the issue.

  "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"
  },

@nicksterx
Copy link

@cdcooksey Did you clear out your node modules and rerun npm install?

harunurhan added a commit to harunurhan/record-editor that referenced this issue Aug 18, 2016
* 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
@danimbrogno
Copy link

Experiencing same issue, downgrading to 0.6.13 as @cdcooksey mentioned did not resolve the issue for me.

dxbykov added a commit to DevExpress/devextreme-angular that referenced this issue Aug 18, 2016
@matt-psaltis
Copy link

As of 0.6.15, the proxy-zone package has been renamed to proxy. The following imports work for us.

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'); // since zone.js 0.6.15
require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14

@c24w
Copy link

c24w commented Aug 22, 2016

@SaltyDH thanks - we found the order of the dependencies was also important...

sebastianhaas added a commit to sebastianhaas/medical-appointment-scheduling that referenced this issue Aug 22, 2016
ddellamico pushed a commit to ddellamico/ionic2-conference-app that referenced this issue Aug 23, 2016
katowulf added a commit to katowulf/angularfire2 that referenced this issue Aug 24, 2016
…created to address this.

Commented test units to correct `error TS2339`; bug angular#467 created to address this.
pawelnd added a commit to pawelnd/github-talent-finder that referenced this issue Aug 25, 2016
AilisObrian added a commit to AilisObrian/HelloNg2CliRc6 that referenced this issue Sep 12, 2016
abesto added a commit to abesto/zipkin-ui that referenced this issue Sep 16, 2016
rogeralsing added a commit to openzipkin-attic/zipkin-ui that referenced this issue Sep 16, 2016
davideast pushed a commit to angular/angularfire that referenced this issue Sep 19, 2016
* 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.
@develand
Copy link

Fixed by updating the 'files' array in karma.config.js with:

  'node_modules/zone.js/dist/zone.js',        
  'node_modules/zone.js/dist/long-stack-trace-zone.js',
  'node_modules/zone.js/dist/async-test.js',
  'node_modules/zone.js/dist/fake-async-test.js',
  'node_modules/zone.js/dist/sync-test.js',
  'node_modules/zone.js/dist/proxy-zone.js',
  'node_modules/zone.js/dist/proxy.js',
  'node_modules/zone.js/dist/jasmine-patch.js',

NOTE: as indicated by others, the order is important

flibbertigibbet added a commit to flibbertigibbet/climate-change-lab that referenced this issue Jan 12, 2017
flibbertigibbet added a commit to flibbertigibbet/climate-change-lab that referenced this issue Jan 13, 2017
@rsheptolut
Copy link

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.

@julie-ng
Copy link

The sort order I needed for Angular 4.0.0 generated using the CLI was so:

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'

@RoestVrijStaal
Copy link

@julie-ng In which file did you throw those imports in?

@swiftcrossing
Copy link

@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.

@JiaLiPassion
Copy link
Collaborator

I have made a PR #982 to add a new zone-testing file , hope it can resolve this issue.

mhevery pushed a commit that referenced this issue Dec 21, 2017
* 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
@mitschmidt
Copy link

Same issue for me, after tslint auto fixed many files in my project the client tests did not work anymore.
Thanks for the hint with the import orders, that solved the problem for me.

@rcollette
Copy link

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';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.