Browse Source

test: remove `require('buffer')` from 4 test files

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 <vsemozhetbyt@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
v6
XadillaX 8 years ago
committed by Alexey Orlenko
parent
commit
befede64f1
No known key found for this signature in database GPG Key ID: 81255941FDDB24ED
  1. 1
      test/parallel/test-stream-uint8array.js
  2. 1
      test/parallel/test-stream2-finish-pipe.js
  3. 1
      test/parallel/test-tls-session-cache.js
  4. 1
      test/parallel/test-vm-cached-data.js

1
test/parallel/test-stream-uint8array.js

@ -1,7 +1,6 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
const assert = require('assert'); const assert = require('assert');
const Buffer = require('buffer').Buffer;
const { Readable, Writable } = require('stream'); const { Readable, Writable } = require('stream');

1
test/parallel/test-stream2-finish-pipe.js

@ -22,7 +22,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
const stream = require('stream'); const stream = require('stream');
const Buffer = require('buffer').Buffer;
const r = new stream.Readable(); const r = new stream.Readable();
r._read = function(size) { r._read = function(size) {

1
test/parallel/test-tls-session-cache.js

@ -46,7 +46,6 @@ function doTest(testOptions, callback) {
const fs = require('fs'); const fs = require('fs');
const join = require('path').join; const join = require('path').join;
const spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
const Buffer = require('buffer').Buffer;
const keyFile = join(common.fixturesDir, 'agent.key'); const keyFile = join(common.fixturesDir, 'agent.key');
const certFile = join(common.fixturesDir, 'agent.crt'); const certFile = join(common.fixturesDir, 'agent.crt');

1
test/parallel/test-vm-cached-data.js

@ -3,7 +3,6 @@ require('../common');
const assert = require('assert'); const assert = require('assert');
const vm = require('vm'); const vm = require('vm');
const spawnSync = require('child_process').spawnSync; const spawnSync = require('child_process').spawnSync;
const Buffer = require('buffer').Buffer;
function getSource(tag) { function getSource(tag) {
return `(function ${tag}() { return '${tag}'; })`; return `(function ${tag}() { return '${tag}'; })`;

Loading…
Cancel
Save