Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add test cases for util.promisify
  • Loading branch information
kakts committed Dec 11, 2017
commit 84bef02b81aedf786f60284e210bf71b17831894
14 changes: 14 additions & 0 deletions test/parallel/test-util-promisify.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ const stat = promisify(fs.stat);
assert.strictEqual(promisify(promisify(fn)), promisifedFn);
}

{
common.expectsError(
() => promisify(undefined),
{ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }
);
}

{
common.expectsError(
() => promisify(null),
{ code: 'ERR_INVALID_ARG_TYPE', type: TypeError }
);
}

{
function fn() {}
fn[promisify.custom] = 42;
Expand Down