Repository navigation
Expand file tree
/
Copy pathgrunt.js
More file actions
109 lines (95 loc) · 2.23 KB
/
Copy pathgrunt.js
File metadata and controls
109 lines (95 loc) · 2.23 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
var _ = require('underscore');
function filterFiles(grunt, pattern, blacklist) {
var files = grunt.file.expand(pattern);
return _.reject(files, function (file) {
return _.any(blacklist, function (ignored) {
return file === ignored || file.match(ignored);
});
});
}
function testFiles(grunt) {
return filterFiles(grunt, 'test/**/*.js', [
'test/fixtures/synclets/twitter/related.js'
]);
}
function libFiles(grunt) {
return filterFiles(grunt, 'lib/**/*.js', [
/services/,
'lib/firebase-auth-server.js',
'lib/firebase-token-generator-node.js'
]);
}
function serviceFiles(grunt) {
return filterFiles(grunt, 'lib/services/**/*.js', [
'lib/services/gmail/imap/xregexp.js'
]);
}
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
simplemocha: {
all: {
src: 'test/**/*.test.js',
options: {
globals: ['should'],
timeout: 10000,
ignoreLeaks: false
}
}
},
lint: {
grunt : 'grunt.js',
lib : libFiles(grunt),
services : serviceFiles(grunt),
tests : testFiles(grunt),
scripts : 'scripts/**/*.js'
},
watch: {
files: '<config:lint.lib>',
tasks: 'default'
},
jshint: {
options: {
curly: false,
latedef: false,
strict: false,
boss: true,
eqeqeq: true,
eqnull: true,
immed: true,
newcap: true,
noarg: true,
node: true,
sub: true,
undef: true
},
globals: {
exports: true,
console: true,
module: true,
process: true,
require: true,
__dirname: true,
btoa: true,
document: true,
window: true,
clearTimeout: true,
setTimeout: true,
setInterval: true,
clearInterval: true,
it: true,
xit: true,
describe: true,
xdescribe: true,
before: true,
beforeEach: true,
afterEach: true,
after: true
}
}
});
grunt.loadNpmTasks('grunt-simple-mocha');
// Default task.
grunt.registerTask('default', 'lint:lib lint:services simplemocha');
};