Browse Source

test: add test case of PassThrough

This commit adds the test case of PassThrough.
This test case checks that PassThrough can
construct without new operator.

This is a part of Code And Learn at NodeFest 2016

Fixes: https://github.com/nodejs/code-and-learn/issues/58
PR-URL: https://github.com/nodejs/node/pull/9581
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
v4.x
Yoshiya Hinosawa 8 years ago
committed by Myles Borins
parent
commit
8345ffb0a0
  1. 8
      test/parallel/test-stream2-transform.js

8
test/parallel/test-stream2-transform.js

@ -106,6 +106,14 @@ test('object passthrough', function(t) {
t.end(); t.end();
}); });
test('passthrough constructor', function(t) {
const pt = PassThrough();
assert(pt instanceof PassThrough);
t.end();
});
test('simple transform', function(t) { test('simple transform', function(t) {
var pt = new Transform(); var pt = new Transform();
pt._transform = function(c, e, cb) { pt._transform = function(c, e, cb) {

Loading…
Cancel
Save