From 3e11408f44592ff4d2d2709537e866eb6a305a58 Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Wed, 26 Mar 2014 21:07:10 -0400 Subject: [PATCH] Fix failing travis/phantomjs tests by adding testing web server--run npm install --- gruntfile.js | 17 ++++++++++++++--- package.json | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 0aa3f44..4fd102e 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -39,11 +39,21 @@ module.exports = function(grunt) { ] }, + connect: { + server: { + options: { + port: 9001, + hostname: '127.0.0.1', + base: '.' + } + } + }, + mocha: { test: { - src: 'tests/index.html', options: { - log: true + log: true, + urls: [ 'http://127.0.0.1:9001/tests/index.html' ] } } }, @@ -81,11 +91,12 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-requirejs'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-mocha'); + grunt.loadNpmTasks('grunt-contrib-connect'); grunt.registerTask('develop', ['clean', 'requirejs']); grunt.registerTask('release', ['develop', 'uglify']); grunt.registerTask('check', ['jshint']); - grunt.registerTask('test', ['check', 'mocha']); + grunt.registerTask('test', ['check', 'connect', 'mocha']); grunt.registerTask('default', ['develop']); }; diff --git a/package.json b/package.json index d73d5ea..7a5fbde 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "grunt-contrib-connect": "~0.1.2", "grunt-contrib-concat": "~0.1.3", "grunt-contrib-jshint": "~0.7.1", - "grunt-mocha": "0.4.10" + "grunt-mocha": "0.4.10", + "grunt-contrib-connect": "~0.7.1" } }