mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-29 12:40:34 +08:00
Renamed q test file.
This commit is contained in:
1 parent
105af2df70
commit
c0fb4cc5c3
1 file changed
@@ -0,0 +1,27 @@
|
||||
/// <reference path="q.module.d.ts" />
|
||||
/// <reference path="../jasmine/jasmine.d.ts" />
|
||||
|
||||
import q = module("q");
|
||||
|
||||
describe("q", function () {
|
||||
it("should return", function (done) {
|
||||
q({ myValue: true }).then(function (obj) {
|
||||
|
||||
if (obj.myValue) done();
|
||||
else done("didn't work =(");
|
||||
},
|
||||
(err) => done(err));
|
||||
});
|
||||
|
||||
it("should process all", function (done: (err?) => void) {
|
||||
q.all([q(1), q(2), q(3)]).then(function (arr: number[]) {
|
||||
var sum = arr.reduce(function (memo, cur) {
|
||||
return memo + cur;
|
||||
}, 0);
|
||||
|
||||
if (sum === 6) done();
|
||||
else done({ actual: sum });
|
||||
},
|
||||
(err) => done(err));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user