Commit 6ece8fda authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

curl+easier test task

parent cf1011a6
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -10,16 +10,12 @@ module.exports = function(grunt) {
      }
    },
    mocha_phantomjs: {
      after: {
        options: {
          urls: [ //my ide requries process.env.IP and PORT
          "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/opt.html"]
        }
      },
      amd: {
      all: {
        options: {
          urls: [ //my ide requries process.env.IP and PORT
          "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/amd.html"]
            "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/amd.html",
            "http://" + (process.env.IP || "127.0.0.1") + ":" + (process.env.PORT || "8080") + "/test/opt.html"
          ]
        }
      }
    },
@@ -58,5 +54,5 @@ module.exports = function(grunt) {
  grunt.registerTask('version', function() {
    grunt.file.write('./lib/version.js', "module.exports = '" + grunt.file.readJSON('package.json').version + "';");
  });
  grunt.registerTask('default', ['version', 'jshint', 'browserify', 'uglify', 'connect','mocha_phantomjs:after', 'mocha_phantomjs:amd']);
  grunt.registerTask('default', ['version', 'jshint', 'browserify', 'uglify', 'connect','mocha_phantomjs']);
};
+1 −1
Original line number Diff line number Diff line
@@ -36,6 +36,6 @@
    "browserify": "~2.33.1",
    "grunt-browserify": "~1.2.8",
    "grunt-contrib-uglify": "~0.2.4",
    "requirejs": "~2.1.8"
    "curl": "git://github.com/cujojs/curl.git"
  }
}
+18 −9
Original line number Diff line number Diff line
@@ -8,16 +8,18 @@
  <script src="../node_modules/mocha/mocha.js"></script>
  <div id="mocha"></div>
  <script src="testData.js"></script>
  <script src="../node_modules/requirejs/require.js"></script>
  <script src="../node_modules/curl/src/curl.js"></script>
  <script src="test.js"></script>
  <script>
  window.run = function(){
  if (window.mochaPhantomJS) { window.mochaPhantomJS.run(); }
      else { window.mocha.run(); }
    if (window.mochaPhantomJS) {
      window.mochaPhantomJS.run();
    } else {
      window.mocha.run();
    }
   requirejs.config({
  }  
  curl.config({
    //By default load any module IDs from js/lib
    baseUrl: '../dist',
   waitSeconds:15,
    use: {
        mocha: {
@@ -33,9 +35,16 @@
        aWKT: {
            attach: 'aWKT'
        }
    },packages: [
        {
            name: 'proj4',
            location: '../lib',
            main: 'index.js',
            config: { moduleLoader: '../node_modules/curl/src/curl/loader/cjsm11' } /* <-- hey! */
        }
    ]
});
   requirejs(['../node_modules/chai/chai.js', 'proj4'],startTests);
   curl(['../node_modules/chai/chai.js', 'proj4']).then(startTests);
   
 </script>