Node: test: remove unnecessary Buffer imports

Created on 21 Jun 2017  路  10Comments  路  Source: nodejs/node

We don't use the global Buffer throughout the lib/ to avoid circular dependency issues in core, and we have a custom lint rule to prevent doing so by accident. But before https://github.com/nodejs/node/pull/5371 this rule used to be applied to the whole project instead of just lib/. Now that the rule only applies to the relevant part of the codebase, all the instances of

const Buffer = require('buffer').Buffer;

and

const { Buffer } = require('buffer');

can be safely removed from the files in the test/ directory.

buffer test

Most helpful comment

All pull requests have landed on master, thank you all and hope to see new contributions from you :)

All 10 comments

I did this grep yesterday, so here's a list...

test\disabled

  • [x] test-sendfd.js (#13860)

    test\internet

  • [x] test-dgram-broadcast-multi-process.js (#13860)

    test\parallel

  • [x] test-buffer-alloc.js (#13855)

  • [x] test-buffer-arraybuffer.js (#13855)
  • [x] test-buffer-badhex.js (#13855)
  • [x] test-buffer-bytelength.js (#13855)
  • [x] test-buffer-fakes.js (#13846)
  • [x] test-buffer-includes.js (#13846)
  • [x] test-buffer-indexof.js (#13846)
  • [x] test-buffer-new.js (#13846)
  • [x] test-buffer-nopendingdep-map.js (#13851)
  • [x] test-buffer-pending-deprecation.js (#13851)
  • [x] test-buffer-sharedarraybuffer.js (#13851)
  • [x] test-buffer-slow.js (#13851)
  • [x] test-buffer-tojson.js (#13851)
  • [x] test-buffer-zero-fill.js (#13851)
  • [x] test-fs-mkdtemp.js (#13845)
  • [x] test-fs-read-zero-length.js (#13845)
  • [x] test-fs-read.js (#13845)
  • [x] test-fs-whatwg-url.js (#13845)
  • [x] test-fs-write-string-coerce.js (#13845)
  • [x] test-fs-write.js (#13845)
  • [x] test-stream-uint8array.js (#13844)
  • [x] test-stream2-finish-pipe.js (#13844)
  • [x] test-tls-session-cache.js (#13844)
  • [x] test-vm-cached-data.js (#13844)

    test\pummel

  • [x] test-https-no-reader.js (#13860)

Going to use to onboard people today, cheers!

Going to work on:

test-buffer-alloc.js
test-buffer-arraybuffer.js
test-buffer-badhex.js
test-buffer-bytelength.js

Cheers

I'm trying to fix:

test-fs-mkdtemp.js
test-fs-read-zero-length.js
test-fs-read.js
test-fs-whatwg-url.js
test-fs-write-string-coerce.js
test-fs-write.js

:)

I'll start on the three stand-alone scripts

test\disabled\test-sendfd.js

test\internet\test-dgram-broadcast-multi-process.js

test\pummel\test-https-no-reader.js

UPDATE: almost there, sorry for the delay!

I'll work for

  • [x] test-stream-uint8array.js
  • [x] test-stream2-finish-pipe.js
  • [x] test-tls-session-cache.js
  • [x] test-vm-cached-data.js

I'll work for

  • test-buffer-fakes.js
  • test-buffer-includes.js
  • test-buffer-indexof.js
  • test-buffer-new.js

I'll take :
test-buffer-nopendingdep-map.js
test-buffer-pending-deprecation.js
test-buffer-sharedarraybuffer.js
test-buffer-slow.js
test-buffer-tojson.js
test-buffer-zero-fill.js

Looks like all the tests have been taken and made into pull requests. So removing the good-first-contribution tag.

All pull requests have landed on master, thank you all and hope to see new contributions from you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipesilvaa picture filipesilvaa  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments

Icemic picture Icemic  路  3Comments

jmichae3 picture jmichae3  路  3Comments

mcollina picture mcollina  路  3Comments