forked from ddrdushy/FCC-Status
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js.bak
91 lines (74 loc) · 2.22 KB
/
Gruntfile.js.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*global module*/
/* Installing jscoverage on ubuntu trusty */
/* sudo apt-get install jscoverage */
module.exports = function (grunt) {
'use strict';
var gruntConfig = {
pkg: grunt.file.readJSON('package.json')
};
grunt.loadNpmTasks('grunt-contrib-jshint');
gruntConfig.jshint = {
options: { bitwise: true, camelcase: true, curly: true, eqeqeq: true, forin: true, immed: true,
indent: 2, latedef: true, newcap: true, noarg: true, noempty: true, nonew: true, plusplus: true,
quotmark: true, regexp: true, undef: true, unused: true, strict: true, trailing: true,
maxparams: 3, maxdepth: 2, maxstatements: 50},
all: [
'Gruntfile.js',
'src/js/**/*.js'
]
};
grunt.initConfig(gruntConfig);
grunt.registerTask('travis', ['jshint', 'test']);
grunt.loadNpmTasks('grunt-contrib-qunit');
gruntConfig.qunit = {
src: ['src/test/index.html']
};
/*grunt.registerTask('test', 'qunit:src');*/
gruntConfig.watch = {
scripts: {
files: ['src/**/*.*'],
tasks: ['jshint', 'test']
}
};
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-qunit-cov');
// test
grunt.loadNpmTasks('grunt-contrib-qunit');
gruntConfig.qunit = {
src: ['src/test/index.html'],
serve: { options: { urls: ['http://localhost:8082/test/index.html']}},
bundle: ['output/bundle/test/index.html']
};
grunt.loadNpmTasks('grunt-qunit-junit');
gruntConfig.qunit_junit = {
options: {
dest: 'output/testresults'
}
};
// serve
grunt.registerTask('wait', 'keep running until terminated', function () {
/* var done =*/
this.async();
});
grunt.loadNpmTasks('grunt-contrib-connect');
gruntConfig.connect = {};
gruntConfig.connect.test = {
options: {
port: 8082,
base: 'src'
}
};
grunt.registerTask('test', ['qunit_junit', 'connect:test', 'qunit:serve']);
gruntConfig['qunit-cov'] = {
test:
{
minimum: 0.99,
baseDir: 'src',
srcDir: 'src/js',
depDirs: ['src/test/lib', 'src/test'],
outDir: 'output/coverage',
testFiles: ['src/test/index.html']
}
};
grunt.registerTask('coverage', 'qunit-cov');
};