diff options
author | Rich Trott <rtrott@gmail.com> | 2016-08-06 21:52:23 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-08-09 23:42:21 -0700 |
commit | 4c62892a4b0ee521a8b55c775d5f890b5f9d50bf (patch) | |
tree | 072ce1d83c4c520cceea94fc24223bc42f4bf238 /test/parallel/test-console-instance.js | |
parent | 8726a1c318cfa8284df87cba83dc713d84cf0a5f (diff) | |
download | node-new-4c62892a4b0ee521a8b55c775d5f890b5f9d50bf.tar.gz |
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.
PR-URL: https://github.com/nodejs/node/pull/8003
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: JacksonTian - Jackson Tian <shvyo1987@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-console-instance.js')
-rw-r--r-- | test/parallel/test-console-instance.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index 2a8a6e3678..b8d9880865 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); +}); |