From cdc04a356300bce0c0b1ae462395ee4acbd30a82 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 6 Aug 2016 21:52:23 -0700 Subject: [PATCH] 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. --- test/parallel/test-console-instance.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index 2a8a6e3678f58a..b8d9880865530b 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -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); +});