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

Commit

Permalink
fix(test): add flag to patch jasmine.clock, move fakeAsync/async into…
Browse files Browse the repository at this point in the history
… original bundle (#1067)
  • Loading branch information
JiaLiPassion authored and mhevery committed Apr 2, 2018
1 parent 7aebdbd commit 389762c
Show file tree
Hide file tree
Showing 24 changed files with 483 additions and 518 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ script:
- node_modules/.bin/karma start karma-dist-sauce-selenium3-jasmine.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-selenium3-mocha.conf.js --single-run
- node_modules/.bin/gulp test/node
- node_modules/.bin/gulp test/node -no-patch-clock
- node_modules/.bin/gulp test/bluebird
- node simple-server.js 2>&1> server.log&
- node ./test/webdriver/test.sauce.js
Expand All @@ -48,3 +49,4 @@ script:
- node_modules/.bin/karma start karma-dist-sauce-jasmine3.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-selenium3-mocha.conf.js --single-run
- node_modules/.bin/gulp test/node
- node_modules/.bin/gulp test/node -no-patch-clock
107 changes: 0 additions & 107 deletions dist/zone-async-testing.js

This file was deleted.

161 changes: 0 additions & 161 deletions dist/zone-fake-async.js

This file was deleted.

64 changes: 47 additions & 17 deletions dist/zone-mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,16 @@ var Zone$1 = (function (global) {
return global['Zone'] = Zone;
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);

var __values = (undefined && undefined.__values) || function (o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m) return m.call(o);
return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
};
Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ObjectDefineProperty = Object.defineProperty;
Expand Down Expand Up @@ -916,14 +926,24 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
function onReject(error) {
promise && (promise = null || reject(error));
}
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
var value = values_1[_i];
if (!isThenable(value)) {
value = this.resolve(value);
try {
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
var value = values_1_1.value;
if (!isThenable(value)) {
value = this.resolve(value);
}
value.then(onResolve, onReject);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
}
value.then(onResolve, onReject);
finally { if (e_1) throw e_1.error; }
}
return promise;
var e_1, _a;
};
ZoneAwarePromise.all = function (values) {
var resolve;
Expand All @@ -934,23 +954,33 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
});
var count = 0;
var resolvedValues = [];
for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {
var value = values_2[_i];
if (!isThenable(value)) {
value = this.resolve(value);
}
value.then((function (index) { return function (value) {
resolvedValues[index] = value;
count--;
if (!count) {
resolve(resolvedValues);
try {
for (var values_2 = __values(values), values_2_1 = values_2.next(); !values_2_1.done; values_2_1 = values_2.next()) {
var value = values_2_1.value;
if (!isThenable(value)) {
value = this.resolve(value);
}
}; })(count), reject);
count++;
value.then((function (index) { return function (value) {
resolvedValues[index] = value;
count--;
if (!count) {
resolve(resolvedValues);
}
}; })(count), reject);
count++;
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
}
finally { if (e_2) throw e_2.error; }
}
if (!count)
resolve(resolvedValues);
return promise;
var e_2, _a;
};
ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {
var chainPromise = new this.constructor(null);
Expand Down
Loading

0 comments on commit 389762c

Please sign in to comment.