From 005e343339a5972bb5062a5a75f8bfea3fa967a2 Mon Sep 17 00:00:00 2001 From: XadillaX Date: Thu, 22 Jun 2017 00:38:31 +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 We don't use the global Buffer throughout the lib/ to avoid circular dependency issues in core, but we actually don't need to require it on test files. So remove them on: + test/parallel/test-stream-uint8array.js + test/parallel/test-stream2-finish-pipe.js + test/parallel/test-tls-session-cache.js + test/parallel/test-vm-cached-data.js Refs: https://github.com/nodejs/node/issues/13836 PR-URL: https://github.com/nodejs/node/pull/13844 Reviewed-By: Vse Mozhet Byt Reviewed-By: Alexey Orlenko Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Timothy Gu Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Michael Dawson --- test/parallel/test-stream-uint8array.js | 1 - test/parallel/test-stream2-finish-pipe.js | 1 - test/parallel/test-tls-session-cache.js | 1 - test/parallel/test-vm-cached-data.js | 1 - 4 files changed, 4 deletions(-) diff --git a/test/parallel/test-stream-uint8array.js b/test/parallel/test-stream-uint8array.js index 1b02c55d97fdc3..38a45d54048967 100644 --- a/test/parallel/test-stream-uint8array.js +++ b/test/parallel/test-stream-uint8array.js @@ -1,7 +1,6 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const Buffer = require('buffer').Buffer; const { Readable, Writable } = require('stream'); diff --git a/test/parallel/test-stream2-finish-pipe.js b/test/parallel/test-stream2-finish-pipe.js index 3fcdbc07d35ab1..4744093e18f9fa 100644 --- a/test/parallel/test-stream2-finish-pipe.js +++ b/test/parallel/test-stream2-finish-pipe.js @@ -22,7 +22,6 @@ 'use strict'; require('../common'); const stream = require('stream'); -const Buffer = require('buffer').Buffer; const r = new stream.Readable(); r._read = function(size) { diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index 5a380597f5078a..e87c62d3ed9416 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -46,7 +46,6 @@ function doTest(testOptions, callback) { const fs = require('fs'); const join = require('path').join; const spawn = require('child_process').spawn; - const Buffer = require('buffer').Buffer; const keyFile = join(common.fixturesDir, 'agent.key'); const certFile = join(common.fixturesDir, 'agent.crt'); diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js index 59cdca9c99f062..5302d73c2df617 100644 --- a/test/parallel/test-vm-cached-data.js +++ b/test/parallel/test-vm-cached-data.js @@ -3,7 +3,6 @@ require('../common'); const assert = require('assert'); const vm = require('vm'); const spawnSync = require('child_process').spawnSync; -const Buffer = require('buffer').Buffer; function getSource(tag) { return `(function ${tag}() { return '${tag}'; })`;