aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-writable-null.js
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2017-11-10 19:18:12 +0100
committerJames M Snell <jasnell@gmail.com>2017-11-12 10:29:45 -0800
commit3fe165ace6723b1446994574a5197bb70d9a6c72 (patch)
treebec4ec690231e7c71a3d5a9dacbf10ff9b7e189e /test/parallel/test-stream-writable-null.js
parentc5a49e148d3293eb9e8c17a15cb8c876977f76af (diff)
downloadandroid-node-v8-3fe165ace6723b1446994574a5197bb70d9a6c72.tar.gz
android-node-v8-3fe165ace6723b1446994574a5197bb70d9a6c72.tar.bz2
android-node-v8-3fe165ace6723b1446994574a5197bb70d9a6c72.zip
test: use ES6 classes instead of util.inherits
PR-URL: https://github.com/nodejs/node/pull/16938 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'test/parallel/test-stream-writable-null.js')
-rw-r--r--test/parallel/test-stream-writable-null.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/parallel/test-stream-writable-null.js b/test/parallel/test-stream-writable-null.js
index d8e90e5c4e..f1b91dee21 100644
--- a/test/parallel/test-stream-writable-null.js
+++ b/test/parallel/test-stream-writable-null.js
@@ -3,18 +3,17 @@ const common = require('../common');
const assert = require('assert');
const stream = require('stream');
-const util = require('util');
-function MyWritable(options) {
- stream.Writable.call(this, options);
-}
-
-util.inherits(MyWritable, stream.Writable);
+class MyWritable extends stream.Writable {
+ constructor(opt) {
+ super(opt);
+ }
-MyWritable.prototype._write = function(chunk, encoding, callback) {
- assert.notStrictEqual(chunk, null);
- callback();
-};
+ _write(chunk, encoding, callback) {
+ assert.notStrictEqual(chunk, null);
+ callback();
+ }
+}
common.expectsError(
() => {