mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
feat: Jest Test Runner (#2170)
This commit is contained in:
29
packages/ripple-keypairs/test/utils.test.ts
Normal file
29
packages/ripple-keypairs/test/utils.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import assert from 'assert'
|
||||
import * as utils from '../src/utils'
|
||||
|
||||
describe('utils', function () {
|
||||
it('hexToBytes - empty', () => {
|
||||
assert.deepEqual(utils.hexToBytes(''), [])
|
||||
})
|
||||
|
||||
it('hexToBytes - zero', () => {
|
||||
assert.deepEqual(utils.hexToBytes('000000'), [0, 0, 0])
|
||||
})
|
||||
|
||||
it('hexToBytes - DEADBEEF', () => {
|
||||
assert.deepEqual(utils.hexToBytes('DEADBEEF'), [222, 173, 190, 239])
|
||||
})
|
||||
|
||||
it('bytesToHex - DEADBEEF', () => {
|
||||
assert.deepEqual(utils.bytesToHex([222, 173, 190, 239]), 'DEADBEEF')
|
||||
})
|
||||
|
||||
it('bytesToHex - DEADBEEF (Uint8Array)', () => {
|
||||
assert.deepEqual(
|
||||
utils.bytesToHex(new Uint8Array([222, 173, 190, 239])),
|
||||
'DEADBEEF',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
export {}
|
||||
Reference in New Issue
Block a user