UNPKG

1.23 kBJavaScriptView Raw
1var convert = require('../lib')
2 , assert = require('assert')
3 , tests = {};
4
5tests['ppm to ppm'] = function () {
6 assert.strictEqual( convert(1).from('ppm').to('ppm') , 1);
7};
8
9tests['ppb to ppb'] = function () {
10 assert.strictEqual( convert(1).from('ppb').to('ppb') , 1);
11};
12
13tests['ppm to ppb'] = function () {
14 assert.strictEqual( convert(1).from('ppm').to('ppb') , 1000);
15};
16
17tests['ppb to ppm'] = function () {
18 assert.strictEqual( convert(1).from('ppb').to('ppm') , .001);
19};
20
21tests['ppt to ppt'] = function () {
22 assert.strictEqual( convert(1).from('ppt').to('ppt'), 1);
23}
24
25tests['ppm to ppt'] = function () {
26 assert.strictEqual( convert(1).from('ppm').to('ppt'), 1000000);
27}
28
29tests['ppt to ppb'] = function () {
30 assert.strictEqual( convert(1).from('ppt').to('ppb'), .001);
31}
32
33tests['ppt to ppm'] = function () {
34 assert.strictEqual( convert(1).from('ppt').to('ppm'), .000001);
35}
36
37tests['ppq to ppq'] = function () {
38 assert.strictEqual( convert(1).from('ppq').to('ppq'), 1);
39}
40
41tests['ppq to ppt'] = function () {
42 assert.strictEqual( convert(1).from('ppq').to('ppt'), .001);
43}
44
45tests['ppq to ppm'] = function () {
46 assert.strictEqual( convert(1).from('ppq').to('ppm'), .000000001);
47}
48
49module.exports = tests;