diff --git a/lib/Proj.js b/lib/Proj.js index c900103..298edd4 100644 --- a/lib/Proj.js +++ b/lib/Proj.js @@ -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; diff --git a/package.json b/package.json index 1baedc3..114538d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/amd.html b/test/amd.html index d80f9ab..477a1d7 100644 --- a/test/amd.html +++ b/test/amd.html @@ -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! */ }, { diff --git a/test/test.js b/test/test.js index 0d8fa5b..8f3cdad 100644 --- a/test/test.js +++ b/test/test.js @@ -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')); })(); }