Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

cb5f95df5537063df95b8ddcbe56fadfab2b9e5f
[qunit.git] / grunt.js
1 /*global config:true, task:true*/
2 module.exports = function( grunt ) {
3
4 grunt.loadNpmTasks( "grunt-git-authors" );
5
6 grunt.initConfig({
7         pkg: '<json:package.json>',
8         qunit: {
9                 // TODO include 'test/logs.html' as well
10                 qunit: 'test/index.html',
11                 addons: [
12                         'addons/canvas/canvas.html',
13                         'addons/close-enough/close-enough.html',
14                         'addons/composite/composite-demo-test.html'
15                 ]
16         },
17         lint: {
18                 qunit: 'qunit/qunit.js',
19                 addons: 'addons/**.js',
20                 grunt: 'grunt.js'
21                 // TODO fix remaining warnings
22                 // tests: 'test/**.js'
23         },
24         // TODO rmeove this one grunt 0.4 is out, see jquery-ui for other details
25         jshint: (function() {
26                 function parserc( path ) {
27                         var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ),
28                                 settings = {
29                                         options: rc,
30                                         globals: {}
31                                 };
32
33                         (rc.predef || []).forEach(function( prop ) {
34                                 settings.globals[ prop ] = true;
35                         });
36                         delete rc.predef;
37
38                         return settings;
39                 }
40
41                 return {
42                         addons: parserc( "addons/" ),
43                         qunit: parserc( "qunit/" ),
44                         tests: parserc( "test/" )
45                 };
46         })()
47 });
48
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 );
53         }
54         grunt.file.copy( "qunit/qunit.css", "dist/qunit-git.css", {
55                 process: processor
56         });
57         grunt.file.copy( "qunit/qunit.js", "dist/qunit-git.js", {
58                 process: processor
59         });
60 });
61
62 grunt.registerTask( "testswarm", function( commit, configFile ) {
63         var testswarm = require( "testswarm" ),
64                 config = grunt.file.readJSON( configFile ).qunit;
65         testswarm({
66                 url: config.swarmUrl,
67                 pollInterval: 10000,
68                 timeout: 1000 * 60 * 30,
69                 done: this.async()
70         }, {
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"]
78         });
79 });
80
81 grunt.registerTask('default', 'lint qunit');
82
83 };

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf