Skip to content

Commit

Permalink
Add an extra thenResolve test.
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Feb 27, 2013
1 parent 0d3d400 commit 4cd418a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion spec/q-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ describe("timeout", function () {
});

describe("thenResolve", function () {
describe("Resolving with an object", function () {
describe("Resolving with a non-thenable value", function () {
it("returns a promise for that object once the promise is resolved", function () {
var waited = false;
return Q.delay(20)
Expand All @@ -1529,6 +1529,21 @@ describe("thenResolve", function () {
expect(val).toBe('foo');
});
});

describe("based off a rejected promise", function () {
it("does nothing, letting the rejection flow through", function () {
return Q.reject('boo')
.thenResolve('foo')
.then(
function () {
expect(true).toBe(false);
},
function (reason) {
expect(reason).toBe('boo');
}
);
});
});
});

describe("Resolving with an promise", function () {
Expand Down

0 comments on commit 4cd418a

Please sign in to comment.