Skip to content

Commit

Permalink
fix(test): Unhandled Rejectionになっているテストを修正
Browse files Browse the repository at this point in the history
close #275
  • Loading branch information
azu committed Nov 20, 2016
1 parent 837829f commit c1c490f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Ch2_HowToWrite/test/promise-race-other-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("promise-race-other", function () {
});

Promise.race([winnerPromise, loserPromise]).then(function () {
assert(count === [winnerPromise, loserPromise].length);
assert(count !== [winnerPromise, loserPromise].length);
});
});
});
4 changes: 3 additions & 1 deletion Ch2_HowToWrite/test/then-throw-error-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ var assert = require("power-assert");
describe("#badMain", function () {
it("can't handling error", function (done) {
require("../src/then-throw-error").badMain(function (value) {
assert.fail("doesn't call");
assert.fail("doesn't call"); // 呼ばれないはず
}).catch(function(error) { // 代わりに catch できる
assert(error instanceof Error)
});
setTimeout(function () {
done();
Expand Down

0 comments on commit c1c490f

Please sign in to comment.