Add Kilometers/Hour to Miles/Hour conversion and reverse
This commit is contained in:
2
test/kphToMph/kphToMph.js
Normal file
2
test/kphToMph/kphToMph.js
Normal file
@ -0,0 +1,2 @@
|
||||
const kphToMph = (kph) => 0.621371192 * kph;
|
||||
module.exports = kphToMph;
|
||||
12
test/kphToMph/kphToMph.test.js
Normal file
12
test/kphToMph/kphToMph.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
const expect = require('expect');
|
||||
const kphToMph = require('./kphToMph.js');
|
||||
|
||||
test('kphToMph is a Function', () => {
|
||||
expect(kphToMph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns mph from kph.', () => {
|
||||
expect(kphToMph(10)).toBe(6.21371192);
|
||||
});
|
||||
test('Returns mph from kph.', () => {
|
||||
expect(kphToMph(345.4)).toBe(214.62160971679998);
|
||||
});
|
||||
2
test/mphToKph/mphToKph.js
Normal file
2
test/mphToKph/mphToKph.js
Normal file
@ -0,0 +1,2 @@
|
||||
const mphToKph = (mph) => 1.6093440006146922 * mph;
|
||||
module.exports = mphToKph;
|
||||
12
test/mphToKph/mphToKph.test.js
Normal file
12
test/mphToKph/mphToKph.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
const expect = require('expect');
|
||||
const mphToKph = require('./mphToKph.js');
|
||||
|
||||
test('mphToKph is a Function', () => {
|
||||
expect(mphToKph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns kph from mph.', () => {
|
||||
expect(mphToKph(10)).toBe(16.09344000614692);
|
||||
});
|
||||
test('Returns kph from mph.', () => {
|
||||
expect(mphToKph(85.9)).toBe(138.24264965280207);
|
||||
});
|
||||
Reference in New Issue
Block a user