1 /*global config:true, task:true*/
2 module.exports = function( grunt ) {
4 grunt.loadNpmTasks( "grunt-git-authors" );
7 pkg: '<json:package.json>',
9 // TODO include 'test/logs.html' as well
10 qunit: 'test/index.html',
12 'addons/canvas/canvas.html',
13 'addons/close-enough/close-enough.html',
14 'addons/composite/composite-demo-test.html'
16 async: 'test/async.html'
19 qunit: 'qunit/qunit.js',
20 addons: 'addons/**.js',
22 // TODO fix remaining warnings
23 // tests: 'test/**.js'
25 // TODO rmeove this one grunt 0.4 is out, see jquery-ui for other details
27 function parserc( path ) {
28 var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ),
34 (rc.predef || []).forEach(function( prop ) {
35 settings.globals[ prop ] = true;
43 addons: parserc( "addons/" ),
44 qunit: parserc( "qunit/" ),
45 tests: parserc( "test/" )
50 grunt.registerTask( "build-git", function( sha ) {
51 function processor( content ) {
52 var tagline = " - A JavaScript Unit Testing Framework";
53 return content.replace( tagline, "-" + sha + " " + grunt.template.today('isoDate') + tagline );
55 grunt.file.copy( "qunit/qunit.css", "dist/qunit-git.css", {
58 grunt.file.copy( "qunit/qunit.js", "dist/qunit-git.js", {
63 grunt.registerTask( "testswarm", function( commit, configFile ) {
64 var testswarm = require( "testswarm" ),
65 config = grunt.file.readJSON( configFile ).qunit;
69 timeout: 1000 * 60 * 30,
72 authUsername: "qunit",
73 authToken: config.authToken,
74 jobName: 'QUnit commit #<a href="https://github.com/jquery/qunit/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
75 runMax: config.runMax,
76 "runNames[]": "QUnit",
77 "runUrls[]": config.testUrl + commit + "/test/index.html",
78 "browserSets[]": ["popular"]
82 grunt.registerTask('default', 'lint qunit');