6b69ee58a0ab8ae87b61e9c3e98b96fafdf75b40b2aa9a884029839f83415284d781fa27825200954b4f4ccf67b41a2511088a62432698c1703f29e39bad96 564 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict'
  2. const tape = require('tape')
  3. const { BufferList, BufferListStream } = require('../')
  4. const { Buffer } = require('buffer')
  5. tape('isBufferList positives', (t) => {
  6. t.ok(BufferList.isBufferList(new BufferList()))
  7. t.ok(BufferList.isBufferList(new BufferListStream()))
  8. t.end()
  9. })
  10. tape('isBufferList negatives', (t) => {
  11. const types = [
  12. null,
  13. undefined,
  14. NaN,
  15. true,
  16. false,
  17. {},
  18. [],
  19. Buffer.alloc(0),
  20. [Buffer.alloc(0)]
  21. ]
  22. for (const obj of types) {
  23. t.notOk(BufferList.isBufferList(obj))
  24. }
  25. t.end()
  26. })