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: console constructor missing new keyword
The `console.Console()` constructor function handles a missing `new`
keyword. This code is not exercised in the current tests. Add a test for
this.
  • Loading branch information
Trott committed Aug 7, 2016
commit cdc04a356300bce0c0b1ae462395ee4acbd30a82
5 changes: 5 additions & 0 deletions test/parallel/test-console-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ out.write = function(d) {
};
[1, 2, 3].forEach(c.log);
assert.equal(3, called);

// Console() detects if it is called without `new` keyword
assert.doesNotThrow(function() {
Console(out, err);
});