Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 600dbfe

Browse files
committed
Update dependencies and loosen timing windows in tests
1 parent 096dcbe commit 600dbfe

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,24 @@
4040
},
4141
"main": "q.js",
4242
"dependencies": {
43-
"asap": "^2.0.0",
43+
"asap": "^2.0.1",
4444
"pop-iterate": "^1.0.1",
4545
"weak-map": "^1.0.5"
4646
},
4747
"devDependencies": {
48-
"jshint": "^2.4.4",
49-
"jasminum": ">=2.0.5 <3.0.0",
50-
"opener": "^1.3.0",
51-
"promises-aplus-tests": "^1.0.2",
52-
"istanbul": "^0.2.4",
53-
"matcha": "^0.2.0",
5448
"grunt": "^0.4.1",
49+
"grunt-amd-wrap": "^1.0.0",
5550
"grunt-cli": "^0.1.9",
56-
"grunt-contrib-uglify": "^0.2.2",
5751
"grunt-contrib-clean": "^0.5.0",
52+
"grunt-contrib-uglify": "^0.2.2",
5853
"grunt-global-wrap": "^1.1.0",
59-
"grunt-amd-wrap": "^1.0.0",
60-
"grunt-s3": "^0.2.0-alpha.2"
54+
"grunt-s3": "^0.2.0-alpha.2",
55+
"istanbul": "^0.2.4",
56+
"jasminum": "^2.0.6",
57+
"jshint": "^2.4.4",
58+
"matcha": "^0.2.0",
59+
"opener": "^1.3.0",
60+
"promises-aplus-tests": "^1.0.2"
6161
},
6262
"scripts": {
6363
"lint": "jshint q.js",

test/eta-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ describe("estimate", function () {
107107
// The composite ETA of thenPromise should be now + 100ms (this) +
108108
// 200ms (then).
109109
setTimeout(function () {
110-
expect(thenPromise.getEstimate()).toBeNear(now + 300, 10);
110+
expect(thenPromise.getEstimate()).toBeNear(now + 300, 50);
111111
}, 0);
112112

113113
// But the actual time of completion will be now + 200ms (this
114114
// actual) + 300ms (fulfilled actual)
115115
setTimeout(function () {
116-
expect(thenPromise.getEstimate()).toBeNear(now + 500, 10);
116+
expect(thenPromise.getEstimate()).toBeNear(now + 500, 50);
117117
done();
118118
}, 600);
119119
});
@@ -125,7 +125,7 @@ describe("estimate", function () {
125125
it("composes initial estimate for all fulfilled values", function () {
126126
var now = Date.now();
127127
var allPromise = Q.all([Q(), Q(), Q()]);
128-
expect(allPromise.getEstimate()).toBeNear(now, 10);
128+
expect(allPromise.getEstimate()).toBeNear(now, 50);
129129
});
130130

131131
it("composes initial estimate for forever pending values", function () {
@@ -142,14 +142,14 @@ describe("estimate", function () {
142142
var expected = [Infinity, now + 10];
143143
var updates = 0;
144144
allPromise.observeEstimate(function (estimate) {
145-
expect(estimate).toBeNear(expected.shift(), 10);
145+
expect(estimate).toBeNear(expected.shift(), 100);
146146
if (++updates === 2) {
147147
done();
148148
}
149149
});
150150
setTimeout(function () {
151151
oneDeferred.resolve();
152-
}, 10);
152+
}, 50);
153153
});
154154

155155
it("composes estimates", function (done) {
@@ -305,7 +305,7 @@ describe("estimate", function () {
305305
var delayedPromise = Q().delay(100);
306306
var updates = 0;
307307
delayedPromise.observeEstimate(function (estimate) {
308-
expect(estimate).toBeNear(now + 100, 10);
308+
expect(estimate).toBeNear(now + 100, 50);
309309
if (++updates === 2) {
310310
done();
311311
}
@@ -335,7 +335,7 @@ describe("estimate", function () {
335335
var thenResolvedPromise = Q().delay(200).thenResolve(Q().delay(200));
336336
var updates = 0;
337337
thenResolvedPromise.observeEstimate(function (estimate) {
338-
expect(estimate).toBeNear(now + 200, 10);
338+
expect(estimate).toBeNear(now + 200, 50);
339339
if (++updates === 4) {
340340
done();
341341
}

test/q-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,13 +1285,13 @@ describe("delay", function () {
12851285
});
12861286

12871287
it("should delay after resolution", function (done) {
1288-
var promise1 = Q.delay("what", 30);
1289-
var promise2 = promise1.delay(30);
1288+
var promise1 = Q.delay("what", 50);
1289+
var promise2 = promise1.delay(150);
12901290

12911291
setTimeout(function () {
12921292
expect(promise1.isPending()).toBe(false);
12931293
expect(promise2.isPending()).toBe(true);
1294-
}, 40);
1294+
}, 100);
12951295

12961296
promise2.then(function (value) {
12971297
expect(value).toBe("what");

0 commit comments

Comments
 (0)