Files
common/packages/util/src/is/buffer.spec.ts
T
2021-01-03 11:20:22 +01:00

19 lines
413 B
TypeScript

// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { isBuffer } from '.';
describe('isBuffer', (): void => {
it('returns true when a Buffer value', (): void => {
expect(
isBuffer(Buffer.from([]))
).toEqual(true);
});
it('returns false on non-Buffer values', (): void => {
expect(
isBuffer(0)
).toEqual(false);
});
});