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'
18 qunit: 'qunit/qunit.js',
19 addons: 'addons/**.js',
21 // TODO fix remaining warnings
22 // tests: 'test/**.js'
24 // TODO rmeove this one grunt 0.4 is out, see jquery-ui for other details
26 function parserc( path ) {
27 var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ),
33 (rc.predef || []).forEach(function( prop ) {
34 settings.globals[ prop ] = true;
42 addons: parserc( "addons/" ),
43 qunit: parserc( "qunit/" ),
44 tests: parserc( "test/" )
49 grunt.registerTask( "build-git", function( sha ) {
50 function processor( content ) {
51 var tagline = " - A JavaScript Unit Testing Framework";
52 return content.replace( tagline, "-" + sha + " " + grunt.template.today('isoDate') + tagline );
54 grunt.file.copy( "qunit/qunit.css", "dist/qunit-git.css", {
57 grunt.file.copy( "qunit/qunit.js", "dist/qunit-git.js", {
62 grunt.registerTask( "testswarm", function( commit, configFile ) {
63 var testswarm = require( "testswarm" ),
64 config = grunt.file.readJSON( configFile ).qunit;
68 timeout: 1000 * 60 * 30,
71 authUsername: "qunit",
72 authToken: config.authToken,
73 jobName: 'QUnit commit #<a href="https://github.com/jquery/qunit/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
74 runMax: config.runMax,
75 "runNames[]": "QUnit",
76 "runUrls[]": config.testUrl + commit + "/test/index.html",
77 "browserSets[]": ["popular"]
81 grunt.registerTask('default', 'lint qunit');