mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Initial change from Babel/JS to TypeScript (#70)
* will compile as typescript * migrated test suite to use JestJS * Migrated to Jest testing framework and typescript source files * updated deps * updated prepublish * resolved 1 failing test * changed decimal .0 on four tests, it appears that these were the only four tests expecting integer values to have '.0' * added linter * added package-lock * removed tslint in favor of eslint * changed yarn to npm * updated version 2.6->3.0 * removing package lock * updated node version in nvmrc and jest version in package * removed nvmrc * removed some unused functions * replaced data driven with file from master * commitint yarn.lock * removing babel as a dependency in favor of typescript compiling to es5 * removing babel deps * resolved testing issues by migrating helper function * added partial linting functionality for test suite * updated imports for decodeLedgerData * updated test * updated yarn.lock * removed a console.log * added eslint-jest-plugin to package * reverting to old linting, will add linting in next PR * removed comments in shamap * re-adding .nvmrc * npm -> yarn * added . to .eslintrc * added .eslintrc * removing linting for this PR * Changed linting to print a message so that linting doesnt fail in CI * changing back * added newline so diff wont show * removed eslint deps, since linting will be dealt with in a later PR * changed function calls to describe(...)
This commit is contained in:
40
packages/ripple-binary-codec/test/uint.test.js
Normal file
40
packages/ripple-binary-codec/test/uint.test.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const { coreTypes } = require('../dist/types')
|
||||
const { UInt8, UInt64 } = coreTypes
|
||||
|
||||
test('compareToTests', () => {
|
||||
expect(UInt8.from(124).compareTo(UInt64.from(124))).toBe(-0)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt64.from(124).compareTo(UInt8.from(124))).toBe(0)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt64.from(124).compareTo(UInt8.from(123))).toBe(1)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt8.from(124).compareTo(UInt8.from(13))).toBe(1)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt8.from(124).compareTo(124)).toBe(0)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt64.from(124).compareTo(124)).toBe(0)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt64.from(124).compareTo(123)).toBe(1)
|
||||
})
|
||||
|
||||
test('compareToTest', () => {
|
||||
expect(UInt8.from(124).compareTo(13)).toBe(1)
|
||||
})
|
||||
|
||||
test('valueOfTests', () => {
|
||||
let val = UInt8.from(1)
|
||||
val |= 0x2
|
||||
expect(val).toBe(3)
|
||||
})
|
||||
Reference in New Issue
Block a user