Skip to content

Commit

Permalink
test: repro issue with not copying numAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 5, 2018
1 parent 7f3e4e6 commit 952d9db
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/misc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,25 @@ describe('hasHooks', function() {
assert.ok(!k.hasHooks('toString'));
});
});

describe('merge', function() {
it('handles async pres if source doesnt have them', function() {
const k1 = new Kareem();
k1.pre('cook', true, function(next, done) {
execed.first = true;
setTimeout(
function() {
done('error!');
},
5);

next();
});

assert.equal(k1._pres.get('cook').numAsync, 1);

const k2 = new Kareem();
const k3 = k2.merge(k1);
assert.equal(k3._pres.get('cook').numAsync, 1);
});
});

0 comments on commit 952d9db

Please sign in to comment.