-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
92 lines (78 loc) · 1.92 KB
/
Gruntfile.js
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
92
/*jslint indent:2, maxlen:80, node:true*/
'use strict';
// exports
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
watch: {},
jslint: {
all: {
src: [
'**/*.js',
'**/*.json',
'!**/*.min.js',
'!node_modules/**/*',
'!bower_components/**/*'
],
exclude: [],
directives: {
todo: true // TODO: eventually eliminate this exemption
},
options: {
errorsOnly: true,
failOnError: true
}
}
},
mocha: {
all: {
options: {
urls: [
'http://127.0.0.1:9999/test/unminified.html',
'http://127.0.0.1:9999/test/minified.html'
],
run: true
}
}
},
requirejs: {
compile: {
options: {
baseUrl: '.',
mainConfigFile: 'examples/require-config.js',
paths: {
jquery: 'empty:',
q: 'empty:',
rsvp: 'empty:'
},
name: 'test/tests',
out: 'test/tests.min.js'
}
}
},
'saucelabs-mocha': {
all: { options: require('./saucelabs') }
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.registerTask('build', ['requirejs']);
grunt.registerTask('test', ['connect', 'build', 'jslint', 'mocha']);
grunt.registerTask('travis', ['test', 'saucelabs-mocha']);
grunt.registerTask("dev", ["connect", "watch"]);
// Default task.
grunt.registerTask('default', ['build', 'test']);
};