Skip to content

Commit

Permalink
fixed some bugs with mocha test
Browse files Browse the repository at this point in the history
  • Loading branch information
regality committed Mar 14, 2012
1 parent e52ba3c commit 3290513
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/getElevationServer.js
@@ -1,6 +1,6 @@
var util = require('util') var util = require('util')
, http = require('http') , http = require('http')
, geolib = require('geolib'); , geolib = require('../geolib');


describe('Geolib', function() { describe('Geolib', function() {
describe('getElevationServer', function() { describe('getElevationServer', function() {
Expand All @@ -10,14 +10,17 @@ describe('Geolib', function() {
{"lat":40.79938945887229,"lng":-111.76680525603354}, {"lat":40.79938945887229,"lng":-111.76680525603354},
{"lat":40.80354,"lng":-111.77384999999998} {"lat":40.80354,"lng":-111.77384999999998}
]; ];
geolib.getElevation(coords, function (err, result){ geolib.getElevation(coords, function (err, results){
if (err){ if (err){
throw new Error("Could not getelevation"); throw new Error("Could not get elevation");
} else { } else {
Math.floor(results[0].elev).should.be.equal(2211); if (Math.floor(results[0].elev) !== 2211 ||
Math.floor(results[1].elev).should.be.equal(1995); Math.floor(results[1].elev) !== 2011 ||
Math.floor(results[2].elev).should.be.equal(1978); Math.floor(results[2].elev) !== 1978) {
throw new Error("wrong elevation results: " + JSON.stringify(results));
}
} }
done();
}); });
}); });
}); });
Expand Down

0 comments on commit 3290513

Please sign in to comment.