@burstjs/util
Advanced tools
Comparing version 0.1.1 to 0.1.2
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## 0.1.2 | ||
- added `sumNQTStringToNumber` | ||
## 0.1.0-rc.3 | ||
@@ -5,0 +8,0 @@ - Timestamp conversion functions |
{ | ||
"name": "@burstjs/util", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Useful utilities and tools for building Burstcoin applications", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/jest": "^23.3.12" | ||
"@types/jest": "^24.0.12" | ||
}, | ||
@@ -57,3 +57,3 @@ "scripts": { | ||
}, | ||
"gitHead": "5ce4a3e1353fc38227fedac8e562cfa2567e6930" | ||
"gitHead": "9faca336766edb3bb7339aa9bd6822551a1db497" | ||
} |
@@ -38,43 +38,2 @@ import {convertNumberToNQTString} from '../convertNumberToNQTString'; | ||
describe('convertNQTStringToNumber', () => { | ||
it('should convertNQTStringToNumber()', () => { | ||
let burst = convertNQTStringToNumber('000000000'); | ||
expect(burst).toBe(0); | ||
burst = convertNQTStringToNumber('12300000000'); | ||
expect(burst).toBe(123); | ||
burst = convertNQTStringToNumber('-100000000'); | ||
expect(burst).toBe(-1); | ||
burst = convertNQTStringToNumber('123000000'); | ||
expect(burst).toBe(1.23); | ||
}); | ||
it('should fail convertNQTStringToNumber() on invalid input', () => { | ||
try { | ||
const nqt = convertNQTStringToNumber(''); | ||
expect(nqt).toBe('Expected exception'); | ||
} catch (e) { | ||
expect(e.message).toBe('Invalid argument'); | ||
} | ||
try { | ||
const nqt = convertNQTStringToNumber(null); | ||
expect(nqt).toBe('Expected exception'); | ||
} catch (e) { | ||
expect(e.message).toBe('Invalid argument'); | ||
} | ||
try { | ||
const nqt = convertNQTStringToNumber(undefined); | ||
expect(nqt).toBe('Expected exception'); | ||
} catch (e) { | ||
expect(e.message).toBe('Invalid argument'); | ||
} | ||
}); | ||
}); | ||
}); |
49567
61
863