Skip to content

Commit

Permalink
Merge remote-tracking branch 'peakon/promiseBindCatchIntegrationTest'…
Browse files Browse the repository at this point in the history
… into bclement/bluebird-proto-casts
  • Loading branch information
NatalieWolfe committed Feb 27, 2018
2 parents 69e8e2d + 5c3bc27 commit 372d5d7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/integration/instrumentation/promises/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module.exports = function(t, library, loadLibrary) {
testTryBehavior('attempt')

ptap.test('Promise.bind', function(t) {
t.plan(2)
t.plan(3)

t.test('context', function(t) {
testPromiseContext(t, function(Promise, name) {
Expand All @@ -167,6 +167,19 @@ module.exports = function(t, library, loadLibrary) {
})
})
})

t.test('catch', function(t) {
var ctx = {}
var err = new Error('oh dear')
testPromiseClassMethod(t, 2, function(Promise, name) {
return new Promise(function(resolve, reject) {
reject(err)
}).bind(ctx, name).catch(function(reason) {
t.equal(this, ctx, 'should have expected `this` value')
t.equal(reason, err, 'should not change rejection reason')
})
})
})
})

testResolveBehavior('cast')
Expand Down

0 comments on commit 372d5d7

Please sign in to comment.