-
Notifications
You must be signed in to change notification settings - Fork 24
/
Gruntfile.js
68 lines (65 loc) · 1.84 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mocha: {
all: {
options: {
reporter: 'Spec'
}
},
ci: {
options: {
}
},
options: {
run: true,
urls: ['http://localhost:8000/index.html'],
}
},
concat: {
options: {
stripBanners: true,
banner: "(function (window, document) {\n'use strict';\n",
footer: '}).call(void(0), window, document);'
},
dist: {
src: [
'lib/assets/javascripts/vanilla-ujs/polyfills.js',
'lib/assets/javascripts/vanilla-ujs/liteajax.js',
'lib/assets/javascripts/vanilla-ujs/confirm.js',
'lib/assets/javascripts/vanilla-ujs/method.js',
'lib/assets/javascripts/vanilla-ujs/disable.js',
'lib/assets/javascripts/vanilla-ujs/csrf.js',
'lib/assets/javascripts/vanilla-ujs/form.js',
],
dest: 'lib/assets/javascripts/vanilla-ujs.js'
}
},
express: {
test: {
options: {
port: 8000,
hostname: 'localhost',
server: 'test/helpers/serv.js',
bases: ['./lib/', './test/']
}
}
},
watch: {
tests: {
files: ["lib/**/*.js", "test/**/*.spec.js"],
tasks: ["test"],
},
}
});
grunt.registerTask('test', ['express:test', 'mocha:all']);
grunt.registerTask('webtest', ['express:test', 'express-keepalive']);
grunt.registerTask('ci', ['express:test', 'mocha:ci']);
grunt.registerTask('dist', ['concat']);
grunt.registerTask('default', ['test']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express');
grunt.loadNpmTasks('grunt-mocha');
};