Files
common/packages/util/src/is/u8a.spec.ts
T
Jaco c4a8aa2dd7 7.2.1 (#1085)
* 7.2.1

* Update CHANGELOG.md

* u8aEmpty
2021-08-15 10:38:48 +02:00

25 lines
510 B
TypeScript

// Copyright 2017-2021 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { isU8a } from '.';
describe('isU8a', (): void => {
it('returns false on undefined values', (): void => {
expect(
isU8a()
).toEqual(false);
});
it('returns false on Array values', (): void => {
expect(
isU8a([])
).toEqual(false);
});
it('returns true on Uint8Array values', (): void => {
expect(
isU8a(new Uint8Array())
).toEqual(true);
});
});