Make tests run and pass

This commit is contained in:
Simon Legner 2017-01-22 18:54:39 +01:00
parent bb8503fcea
commit f7bd5c25a9
4 changed files with 12 additions and 11 deletions

View File

@ -36,18 +36,18 @@ function Projection(srsCode,callback) {
json.k0 = json.k0 || 1.0;
json.axis = json.axis || 'enu';
var sphere = deriveConstants.sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
var ecc = deriveConstants.eccentricity(sphere.a, sphere.b, sphere.rf, json.R_A);
var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere.a, sphere.b, ecc.es, ecc.ep2);
var sphere_ = deriveConstants.sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
var ecc = deriveConstants.eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2);
extend(this, json); // transfer everything over from the projection because we don't know what we'll need
extend(this, ourProj); // transfer all the methods from the projection
// copy the 4 things over we calulated in deriveConstants.sphere
this.a = sphere.a;
this.b = sphere.b;
this.rf = sphere.rf;
this.sphere = sphere.sphere;
this.a = sphere_.a;
this.b = sphere_.b;
this.rf = sphere_.rf;
this.sphere = sphere_.sphere;
// copy the 3 things we calculated in deriveConstants.eccentricity
this.es = ecc.es;

View File

@ -8,7 +8,8 @@
"doc": "docs"
},
"scripts": {
"test": "./node_modules/istanbul/lib/cli.js test ./node_modules/mocha/bin/_mocha test/test.js"
"build": "grunt",
"test": "npm run build && istanbul test _mocha test/test.js"
},
"repository": {
"type": "git",

View File

@ -30,8 +30,8 @@
},packages: [
{
name: 'proj4',
location: '../lib',
main: 'index.js',
location: '../dist',
main: 'proj4-src.js',
config: { moduleLoader: '../node_modules/curl-amd/src/curl/loader/cjsm11' } /* <-- hey! */
},
{

View File

@ -254,6 +254,6 @@ function startTests(chai, proj4, testPoints) {
}
if(typeof process !== 'undefined'&&process.toString() === '[object process]'){
(function(){
startTests(require('chai'), require('../lib'), require('./testData'));
startTests(require('chai'), require('../dist/proj4-src'), require('./testData'));
})();
}