Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed some bugs with mocha test

  • Loading branch information...
commit 3290513544c279bd720bea4862c9f5a6c19e193b 1 parent e52ba3c
@regality regality authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 tests/getElevationServer.js
View
15 tests/getElevationServer.js
@@ -1,6 +1,6 @@
var util = require('util')
, http = require('http')
- , geolib = require('geolib');
+ , geolib = require('../geolib');
describe('Geolib', function() {
describe('getElevationServer', function() {
@@ -10,14 +10,17 @@ describe('Geolib', function() {
{"lat":40.79938945887229,"lng":-111.76680525603354},
{"lat":40.80354,"lng":-111.77384999999998}
];
- geolib.getElevation(coords, function (err, result){
+ geolib.getElevation(coords, function (err, results){
if (err){
- throw new Error("Could not getelevation");
+ throw new Error("Could not get elevation");
} else {
- Math.floor(results[0].elev).should.be.equal(2211);
- Math.floor(results[1].elev).should.be.equal(1995);
- Math.floor(results[2].elev).should.be.equal(1978);
+ if (Math.floor(results[0].elev) !== 2211 ||
+ Math.floor(results[1].elev) !== 2011 ||
+ Math.floor(results[2].elev) !== 1978) {
+ throw new Error("wrong elevation results: " + JSON.stringify(results));
+ }
}
+ done();
});
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.