X-Git-Url: http://git.altlug.ru/?p=qunit.git;a=blobdiff_plain;f=grunt.js;h=2508ba5109d1921def713088de7435975eb868bb;hp=a7c662351b3e8785886a78fb9f290782adb48035;hb=cfc37752b32c6705be421bbacd163454bc0d0236;hpb=97319a0a9fc820046856b4da56770c6a6b7c4ab9 diff --git a/grunt.js b/grunt.js index a7c6623..2508ba5 100644 --- a/grunt.js +++ b/grunt.js @@ -1,37 +1,97 @@ /*global config:true, task:true*/ -config.init({ - pkg: '', - qunit: { - // TODO include 'test/logs.html' as well - files: ['test/index.html'] - }, - lint: { - // TODO lint test files: 'test/**/*.js' - needs seperate globals list - files: ['grunt.js', 'qunit/*.js'] - }, - jshint: { - options: { - bitwise: true, - curly: true, - trailing: true, - immed: true, - latedef: false, - newcap: true, - noarg: false, - noempty: true, - nonew: true, - sub: true, - undef: true, - eqnull: true, - browser: true, - proto: true - }, - globals: { - jQuery: true, - exports: true - } - } +module.exports = function( grunt ) { + +grunt.initConfig({ + pkg: '', + qunit: { + // TODO include 'test/logs.html' as well + qunit: 'test/index.html', + addons: [ + 'addons/canvas/canvas.html', + 'addons/close-enough/close-enough.html', + 'addons/composite/composite-demo-test.html' + ] + }, + lint: { + qunit: 'qunit/qunit.js', + addons: 'addons/**/*.js', + grunt: 'grunt.js' + // TODO need to figure out which warnings to fix and which to disable + // tests: 'test/test.js' + }, + jshint: { + qunit: { + options: { + onevar: true, + browser: true, + bitwise: true, + curly: true, + trailing: true, + immed: true, + latedef: false, + newcap: true, + noarg: false, + noempty: true, + nonew: true, + sub: true, + undef: true, + eqnull: true, + proto: true + }, + globals: { + jQuery: true, + exports: true + } + }, + addons: { + options: { + browser: true, + curly: true, + eqnull: true, + eqeqeq: true, + expr: true, + evil: true, + jquery: true, + latedef: true, + noarg: true, + onevar: true, + smarttabs: true, + trailing: true, + undef: true + }, + globals: { + module: true, + test: true, + asyncTest: true, + expect: true, + start: true, + stop: true, + QUnit: true + } + }, + tests: { + } + } +}); + +grunt.registerTask( "testswarm", function( commit, configFile ) { + var testswarm = require( "testswarm" ), + config = grunt.file.readJSON( configFile ); + testswarm({ + url: "http://swarm.jquery.org/", + pollInterval: 10000, + done: this.async() + }, { + authUsername: "qunit", + authToken: config.qunit.authToken, + jobName: 'QUnit commit #' + commit.substr( 0, 10 ) + '', + runMax: 3, + "runNames[]": "QUnit", + "runUrls[]": "http://swarm.jquery.org/git/qunit/" + commit + "/test/index.html", + "browserSets[]": ["popular"] + }); }); -// Default task. -task.registerTask('default', 'lint qunit'); +grunt.registerTask('default', 'lint qunit'); + +};