Files
common/packages/util/src/hex/toString.spec.ts
T
Jaco Greeff 00374effc5 string <-> hex conversion utilities (#470)
* string <-> hex conversion utilities

* Add tests
2019-09-12 13:48:06 +02:00

20 lines
499 B
TypeScript

// Copyright 2017-2019 @polkadot/util authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { hexToString } from '.';
describe('hexToString', (): void => {
it('converts an empty to ""', (): void => {
expect(
hexToString()
).toEqual('');
});
it('converts to a string from hex', (): void => {
expect(
hexToString('0x68656c6c6f')
).toEqual('hello');
});
});