1 | var convert = require('../lib')
|
2 | , assert = require('assert')
|
3 | , tests = {};
|
4 |
|
5 | tests['C to K'] = function () {
|
6 | assert.strictEqual( convert(0).from('C').to('K'), 273.15);
|
7 | };
|
8 |
|
9 | tests['K to C'] = function () {
|
10 | assert.strictEqual( convert(273.15).from('K').to('C'), 0);
|
11 | };
|
12 |
|
13 | tests['F to C'] = function () {
|
14 | assert.strictEqual( convert(32).from('F').to('C'), 0);
|
15 | };
|
16 |
|
17 | tests['C to F'] = function () {
|
18 | assert.strictEqual( convert(0).from('C').to('F'), 32);
|
19 | };
|
20 |
|
21 | tests['F to K'] = function () {
|
22 | assert.strictEqual( convert(32).from('F').to('K'), 273.15);
|
23 | };
|
24 |
|
25 | tests['F to R'] = function () {
|
26 | assert.strictEqual( convert(100).from('F').to('R'), 559.6700000000001);
|
27 | };
|
28 |
|
29 | tests['R to F'] = function () {
|
30 | assert.strictEqual( convert(670).from('R').to('F'), 210.32999999999998);
|
31 | };
|
32 |
|
33 | tests['R to C'] = function () {
|
34 | assert.strictEqual( convert(612).from('R').to('C'), 66.85);
|
35 | };
|
36 |
|
37 | tests['R to K'] = function () {
|
38 | assert.strictEqual( convert(459.67).from('R').to('K'), 255.3722222222222);
|
39 | };
|
40 |
|
41 | module.exports = tests;
|