Skip to content

Commit

Permalink
Optimize for newest version of express, need to use custom version of…
Browse files Browse the repository at this point in the history
… grunt-express until blai/grunt-express#67 is merged.
  • Loading branch information
benhutchins committed Aug 7, 2014
1 parent 3c0692d commit 56c0752
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"express": "3.x",
"glob": "3.2.x",
"grunt-express": "~1.4.0",
"grunt-express": "benhutchins/grunt-express",
"grunt-mocha": "0.4.x",
"jade": "~0.35",
"request": "^2.34.0",
Expand Down
11 changes: 6 additions & 5 deletions tasks/js-test-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var findTests = require('./lib/findTests');

module.exports = function (grunt) {

grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadTasks(path.join(__dirname, '../node_modules/grunt-express/tasks'));
grunt.loadTasks(path.join(__dirname, '../node_modules/grunt-mocha/tasks'));

function startCoverageServer() {
// start the jscover proxy server
Expand All @@ -51,7 +51,7 @@ module.exports = function (grunt) {
startCoverageServer();
}

var express = Object.merge({
var express = _.extend({}, {
options: {
hostname: options.hostname,
port: options.port,
Expand Down Expand Up @@ -133,7 +133,7 @@ module.exports = function (grunt) {
var options = this.options(defaults);

ensureServerIsRunning(options, function () {
var mochaConfig = Object.merge({
var mochaConfig = _.extend({}, {
urls: ['test/*.unittests.html'],

inject: path.join(__dirname, 'lib', 'phantom-bridge.js'),
Expand Down Expand Up @@ -221,7 +221,8 @@ module.exports = function (grunt) {

// start the js-test-env web server with keepalive
grunt.registerTask('js-test-server', 'Start server with keepalive.', function (target) {
var options = Object.merge(
var options = _.extend(
{},
defaults,
grunt.config.get('js-test.options') || {},
grunt.config.get('js-test.' + target + '.options')
Expand Down
19 changes: 8 additions & 11 deletions tasks/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ var findReferenceTags = require('./deps');

var app = express();

app.configure(function () {
app.locals.pretty = true;
app.set('view engine', 'jade');
// app.use(express.logger('dev'));
app.use(express.bodyParser({ limit: '200mb' }));
// app.use(express.methodOverride());
app.use(express.errorHandler());

// proxy static js-test-env javascript files
app.use('/js-test-env', express.static(path.join(__dirname, '..', '..', 'views', 'deps')));
});
app.locals.pretty = true; // output pretty HTML
app.set('view engine', 'jade');
// app.use(express.logger('dev'));
app.use(express.bodyParser({ limit: '200mb' }));
app.use(express.errorHandler());

// proxy static js-test-env javascript files
app.use('/js-test-env', express.static(path.join(__dirname, '..', '..', 'views', 'deps')));

module.exports = function (grunt, options) {
var tests = require('./findTests')(options);
Expand Down

0 comments on commit 56c0752

Please sign in to comment.