Skip to content

Commit c1c490f

Browse files
committed
fix(test): Unhandled Rejectionになっているテストを修正
close #275
1 parent 837829f commit c1c490f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Ch2_HowToWrite/test/promise-race-other-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("promise-race-other", function () {
2626
});
2727

2828
Promise.race([winnerPromise, loserPromise]).then(function () {
29-
assert(count === [winnerPromise, loserPromise].length);
29+
assert(count !== [winnerPromise, loserPromise].length);
3030
});
3131
});
3232
});

Ch2_HowToWrite/test/then-throw-error-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ var assert = require("power-assert");
33
describe("#badMain", function () {
44
it("can't handling error", function (done) {
55
require("../src/then-throw-error").badMain(function (value) {
6-
assert.fail("doesn't call");
6+
assert.fail("doesn't call"); // 呼ばれないはず
7+
}).catch(function(error) { // 代わりに catch できる
8+
assert(error instanceof Error)
79
});
810
setTimeout(function () {
911
done();

0 commit comments

Comments
 (0)