Skip to content

Commit

Permalink
test(presets): add test for identity conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
javiercejudo committed Oct 9, 2015
1 parent da00345 commit 8a57e8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ function invert(preset) {

describe('velocity presets', function() {
it('should convert correctly', function() {
(100/9.58).should.be.exactly(convert(23.35006567906474, invert(velocity.metresSecond_milesHour)), 'metresSecond_milesHour')
(100/9.58).should.be.exactly(convert(100/9.58, invert(velocity.metresSecond_metresSecond)), 'metresSecond_metresSecond')
.and.exactly(convert(23.35006567906474, invert(velocity.metresSecond_milesHour)), 'metresSecond_milesHour')
.and.exactly(convert(34.24676299596162, invert(velocity.metresSecond_feetSecond)), 'metresSecond_feetSecond')
.and.exactly(convert(37.578288100208766, invert(velocity.metresSecond_kilometresHour)), 'metresSecond_kilometresHour')
.and.exactly(convert(20.290652321926984, invert(velocity.metresSecond_knot)), 'metresSecond_knot');

(0).should.be.exactly(convert(0, velocity.metresSecond_milesHour), 'metresSecond_milesHour')
(0).should.be.exactly(convert(0, velocity.metresSecond_metresSecond), 'metresSecond_metresSecond')
.and.exactly(convert(0, velocity.metresSecond_milesHour), 'metresSecond_milesHour')
.and.exactly(convert(0, velocity.metresSecond_feetSecond), 'metresSecond_feetSecond')
.and.exactly(convert(0, velocity.metresSecond_kilometresHour), 'metresSecond_kilometresHour')
.and.exactly(convert(0, velocity.metresSecond_knot), 'metresSecond_knot');
Expand Down

0 comments on commit 8a57e8f

Please sign in to comment.