source: trip-planner-front/node_modules/bl/test/isBufferList.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 564 bytes
Line 
1'use strict'
2
3const tape = require('tape')
4const { BufferList, BufferListStream } = require('../')
5const { Buffer } = require('buffer')
6
7tape('isBufferList positives', (t) => {
8 t.ok(BufferList.isBufferList(new BufferList()))
9 t.ok(BufferList.isBufferList(new BufferListStream()))
10
11 t.end()
12})
13
14tape('isBufferList negatives', (t) => {
15 const types = [
16 null,
17 undefined,
18 NaN,
19 true,
20 false,
21 {},
22 [],
23 Buffer.alloc(0),
24 [Buffer.alloc(0)]
25 ]
26
27 for (const obj of types) {
28 t.notOk(BufferList.isBufferList(obj))
29 }
30
31 t.end()
32})
Note: See TracBrowser for help on using the repository browser.