Last active
July 28, 2016 08:22
-
-
Save iest/b5a6d94a52701d8fcdc3f4408cacc6b5 to your computer and use it in GitHub Desktop.
Tape
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test from 'tape'; | |
import { mToKm } from '../distance-util'; | |
test('mToKm', (assert) => { | |
assert.equal(typeof(mToKm(1000)), 'string', 'outputs a string'); | |
assert.equal(mToKm(1000), '1.0', 'converts meters to kilometers'); | |
assert.equal(mToKm(1200), '1.2', 'formatted to 1 decimal place'); | |
assert.equal(mToKm(1299), '1.3', 'rounded up correctly'); | |
assert.equal(mToKm(1240), '1.2', 'rounded down correctly'); | |
assert.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment