Permalink
Browse files

Build: Upgraded to Grunt 0.4.0. Fixes #377.

  • Loading branch information...
1 parent 00dea8e commit e5df79c6f83ad01692342f46f8b4c2970147a957 @JamesMGreene committed Mar 7, 2013
Showing with 42 additions and 37 deletions.
  1. 0 {qunit → }/.jshintrc
  2. +29 −32 grunt.js → Gruntfile.js
  3. +4 −3 addons/phantomjs/runner.js
  4. +8 −2 package.json
  5. +1 −0 test/test.js
File renamed without changes.
View
@@ -1,7 +1,9 @@
-/*global config:true, task:true*/
+/*jshint node:true */
module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-git-authors" );
+grunt.loadNpmTasks( "grunt-contrib-jshint" );
+grunt.loadNpmTasks( "grunt-contrib-qunit" );
grunt.initConfig({
pkg: '<json:package.json>',
@@ -10,7 +12,7 @@ grunt.initConfig({
'test/index.html',
'test/async.html'
// TODO figure out why this fails on our Jenkins server (Linux)
- // 'test/logs.html'
+ //'test/logs.html'
],
addons: [
'addons/canvas/canvas.html',
@@ -20,35 +22,29 @@ grunt.initConfig({
// 'addons/step/step.html'
]
},
- lint: {
- qunit: 'qunit/qunit.js',
- addons: 'addons/**.js',
- tests: 'test/**.js',
- grunt: 'grunt.js'
- },
- // TODO remove this once grunt 0.4 is out, see jquery-ui for other details
- jshint: (function() {
- function parserc( path ) {
- var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ),
- settings = {
- options: rc,
- globals: {}
- };
-
- (rc.predef || []).forEach(function( prop ) {
- settings.globals[ prop ] = true;
- });
- delete rc.predef;
-
- return settings;
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc'
+ },
+ gruntfile: ['Gruntfile.js'],
+ qunit: ['qunit/**/*.js'],
+ addons: {
+ options: {
+ jshintrc: 'addons/.jshintrc'
+ },
+ files: {
+ src: ['addons/**/*.js']
+ }
+ },
+ tests: {
+ options: {
+ jshintrc: 'test/.jshintrc'
+ },
+ files: {
+ src: ['test/**/*.js']
+ }
}
-
- return {
- qunit: parserc( "qunit/" ),
- addons: parserc( "addons/" ),
- tests: parserc( "test/" )
- };
- })()
+ }
});
grunt.registerTask( "build-git", function( sha ) {
@@ -91,11 +87,12 @@ grunt.registerTask( "testswarm", function( commit, configFile ) {
if ( err ) {
grunt.log.error( err );
}
- done( passed === true );
+ done( passed );
}
);
});
-grunt.registerTask('default', 'lint qunit');
+grunt.registerTask('default', ['jshint', 'qunit']);
+grunt.registerTask('test', ['jshint', 'qunit']);
};
@@ -17,16 +17,17 @@
(function() {
'use strict';
- var args = require('system').args;
+ var args = require('system').args,
+ url, page;
// arg[0]: scriptName, args[1...]: arguments
if (args.length !== 2) {
console.error('Usage:\n phantomjs runner.js [url-of-your-qunit-testsuite]');
phantom.exit(1);
}
- var url = args[1],
- page = require('webpage').create();
+ url = args[1];
+ page = require('webpage').create();
// Route `console.log()` calls from within the Page context to the main Phantom context (i.e. current `this`)
page.onConsoleMessage = function(msg) {
View
@@ -29,9 +29,15 @@
"jquery"
],
"main": "qunit/qunit.js",
+ "scripts": {
+ "test": "grunt test"
+ },
"devDependencies": {
- "grunt": "0.3.x",
- "grunt-git-authors": "1.0.0",
+ "grunt-cli": "0.1.6",
+ "grunt": "0.4.0",
+ "grunt-contrib-jshint": "0.2.0",
+ "grunt-contrib-qunit": "0.2.0",
+ "grunt-git-authors": "1.1.0",
"testswarm": "1.0.0-alpha"
}
}
View
@@ -470,6 +470,7 @@ test("propEqual", 5, function( assert ) {
});
test("raises", 9, function() {
+ /*jshint es5:true */
function CustomError( message ) {
this.message = message;
}

0 comments on commit e5df79c

Please sign in to comment.