From fff0b83f1b5964d31ccecaa36c0689062ad8b1e0 Mon Sep 17 00:00:00 2001 From: Zongmin Lei Date: Thu, 22 Jun 2017 01:22:33 +0800 Subject: [PATCH] test: remove `require('buffer')` from 4 test files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove superfluous import from: * test/parallel/test-buffer-fakes.js * test/parallel/test-buffer-includes.js * test/parallel/test-buffer-indexof.js * test/parallel/test-buffer-new.js Refs: https://github.com/nodejs/node/issues/13836 PR-URL: https://github.com/nodejs/node/pull/13846 Reviewed-By: Vse Mozhet Byt Reviewed-By: Alexey Orlenko Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Jackson Tian Reviewed-By: Refael Ackermann Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- test/parallel/test-buffer-fakes.js | 1 - test/parallel/test-buffer-includes.js | 2 -- test/parallel/test-buffer-indexof.js | 2 -- test/parallel/test-buffer-new.js | 1 - 4 files changed, 6 deletions(-) diff --git a/test/parallel/test-buffer-fakes.js b/test/parallel/test-buffer-fakes.js index 758ebbf0053732..d126d39aa95263 100644 --- a/test/parallel/test-buffer-fakes.js +++ b/test/parallel/test-buffer-fakes.js @@ -2,7 +2,6 @@ require('../common'); const assert = require('assert'); -const Buffer = require('buffer').Buffer; function FakeBuffer() { } Object.setPrototypeOf(FakeBuffer, Buffer); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 112cf546502372..142602ab46cb9f 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -2,8 +2,6 @@ require('../common'); const assert = require('assert'); -const Buffer = require('buffer').Buffer; - const b = Buffer.from('abcdef'); const buf_a = Buffer.from('a'); const buf_bc = Buffer.from('bc'); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index e389b09e384500..7aab6e609e56d7 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -2,8 +2,6 @@ require('../common'); const assert = require('assert'); -const Buffer = require('buffer').Buffer; - const b = Buffer.from('abcdef'); const buf_a = Buffer.from('a'); const buf_bc = Buffer.from('bc'); diff --git a/test/parallel/test-buffer-new.js b/test/parallel/test-buffer-new.js index 919f31238d2d18..95dd922a271a1a 100644 --- a/test/parallel/test-buffer-new.js +++ b/test/parallel/test-buffer-new.js @@ -2,6 +2,5 @@ require('../common'); const assert = require('assert'); -const Buffer = require('buffer').Buffer; assert.throws(() => new Buffer(42, 'utf8'), /first argument must be a string/);