-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// 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 { stringToHex } from '.'; | ||
|
||
describe('hexToString', (): void => { | ||
it('converts an empty to ""', (): void => { | ||
expect( | ||
stringToHex() | ||
).toEqual('0x'); | ||
}); | ||
|
||
it('converts to a hex from string', (): void => { | ||
expect( | ||
stringToHex('hello') | ||
).toEqual('0x68656c6c6f'); | ||
}); | ||
}); |