1 | var convert = require('../lib')
|
2 | , assert = require('assert')
|
3 | , tests = {};
|
4 |
|
5 | tests['Wh to Wh'] = function () {
|
6 | assert.strictEqual( convert(1).from('Wh').to('Wh') , 1);
|
7 | };
|
8 |
|
9 | tests['mWh to mWh'] = function () {
|
10 | assert.strictEqual( convert(1).from('mWh').to('mWh') , 1);
|
11 | };
|
12 |
|
13 | tests['kWh to kWh'] = function () {
|
14 | assert.strictEqual( convert(1).from('kWh').to('kWh') , 1);
|
15 | };
|
16 |
|
17 | tests['MWh to MWh'] = function () {
|
18 | assert.strictEqual( convert(1).from('MWh').to('MWh') , 1);
|
19 | };
|
20 |
|
21 | tests['GWh to GWh'] = function () {
|
22 | assert.strictEqual( convert(1).from('GWh').to('GWh') , 1);
|
23 | };
|
24 |
|
25 | tests['J to J'] = function () {
|
26 | assert.strictEqual( convert(1).from('J').to('J') , 1);
|
27 | };
|
28 |
|
29 | tests['kJ to kJ'] = function () {
|
30 | assert.strictEqual( convert(1).from('kJ').to('kJ') , 1);
|
31 | };
|
32 |
|
33 | tests['Wh to J'] = function () {
|
34 | assert.strictEqual( convert(1).from('Wh').to('J') , 3600);
|
35 | };
|
36 |
|
37 | tests['Wh to mWh'] = function () {
|
38 | assert.strictEqual( convert(1).from('Wh').to('mWh') , 1000);
|
39 | };
|
40 |
|
41 | tests['Wh to kWh'] = function () {
|
42 | assert.strictEqual( convert(1).from('Wh').to('kWh') , 0.001);
|
43 | };
|
44 |
|
45 | tests['Wh to MWh'] = function () {
|
46 | assert.strictEqual( convert(1).from('Wh').to('MWh') , 0.000001);
|
47 | };
|
48 |
|
49 | tests['Wh to GWh'] = function () {
|
50 | assert.strictEqual( convert(1).from('Wh').to('GWh') , 0.000000001);
|
51 | };
|
52 |
|
53 | tests['GWh to mWh'] = function () {
|
54 | assert.strictEqual( convert(1).from('GWh').to('mWh'), 1000000000000);
|
55 | }
|
56 |
|
57 | tests['GWh to J'] = function () {
|
58 | assert.strictEqual( convert(1).from('GWh').to('J'), 3600000000000);
|
59 | }
|
60 |
|
61 | tests['MWh to mWh'] = function () {
|
62 | assert.strictEqual( convert(1).from('MWh').to('mWh'), 1000000000);
|
63 | }
|
64 |
|
65 | tests['kWh to mWh'] = function () {
|
66 | assert.strictEqual( convert(1).from('kWh').to('mWh'), 1000000);
|
67 | }
|
68 |
|
69 | tests['mWh to kWh'] = function () {
|
70 | assert.strictEqual( convert(1).from('mWh').to('kWh'), 0.000001);
|
71 | }
|
72 |
|
73 | tests['mWh to Wh'] = function () {
|
74 | assert.strictEqual( convert(1).from('mWh').to('Wh'), 0.001);
|
75 | }
|
76 |
|
77 | tests['kWh to Wh'] = function () {
|
78 | assert.strictEqual( convert(1).from('kWh').to('Wh'), 1000);
|
79 | }
|
80 |
|
81 | tests['kWh to kJ'] = function () {
|
82 | assert.strictEqual( convert(1).from('kWh').to('kJ'), 3600);
|
83 | }
|
84 |
|
85 | module.exports = tests;
|