forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunits.test.js
32 lines (23 loc) · 816 Bytes
/
units.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
require('should');
describe('units', function ( ) {
var units = require('../lib/units')();
it('should convert 99 to 5.5', function () {
units.mgdlToMMOL(99).should.equal('5.5');
});
it('should convert 180 to 10.0', function () {
units.mgdlToMMOL(180).should.equal('10.0');
});
it('should convert 5.5 to 99', function () {
units.mmolToMgdl(5.5).should.equal(99);
});
it('should convert 10.0 to 180', function () {
units.mmolToMgdl(10.0).should.equal(180);
});
it('should convert 5.5 mmol and then convert back to 5.5 mmol', function () {
units.mgdlToMMOL(units.mmolToMgdl(5.5)).should.equal('5.5');
});
it('should convert 99 mgdl and then convert back to 99 mgdl', function () {
units.mmolToMgdl(units.mgdlToMMOL(99)).should.equal(99);
});
});