mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 17:57:36 +08:00
DISABLE_THIRD_PARTY_CHECK=update Puppeteer Also-By: tvanderlippe@chromium.org Change-Id: I4ddb6a2b426bcde95f9b764790e88b560441225c Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2187209 Commit-Queue: Mathias Bynens <mathias@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
33 lines
564 B
JavaScript
33 lines
564 B
JavaScript
'use strict'
|
|
|
|
const tape = require('tape')
|
|
const { BufferList, BufferListStream } = require('../')
|
|
const { Buffer } = require('buffer')
|
|
|
|
tape('isBufferList positives', (t) => {
|
|
t.ok(BufferList.isBufferList(new BufferList()))
|
|
t.ok(BufferList.isBufferList(new BufferListStream()))
|
|
|
|
t.end()
|
|
})
|
|
|
|
tape('isBufferList negatives', (t) => {
|
|
const types = [
|
|
null,
|
|
undefined,
|
|
NaN,
|
|
true,
|
|
false,
|
|
{},
|
|
[],
|
|
Buffer.alloc(0),
|
|
[Buffer.alloc(0)]
|
|
]
|
|
|
|
for (const obj of types) {
|
|
t.notOk(BufferList.isBufferList(obj))
|
|
}
|
|
|
|
t.end()
|
|
})
|