forked from BrowserSync/browser-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
118 lines (113 loc) · 3.3 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
'use strict';
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
dirs: {
assets: "test/fixtures",
css: "<%= dirs.assets %>/css",
less: "<%= dirs.assets %>/less",
scss: "<%= dirs.assets %>/scss",
stylus: "<%= dirs.assets %>/stylus"
},
nodeunit: {
files: ['test/**/*_test.js']
},
uglify: {
client_script: {
files: {
'lib/browser-sync-client.min.js': 'lib/browser-sync-client.js'
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['lib/**/*.js', '!lib/browser-sync-client.min.js']
},
test: {
src: ['test/**/*.js']
}
},
watch: {
test: {
files: ['test/**/*.js', 'lib/**/*.js'],
tasks: ['jasmine_node']
},
sass: {
files: ['test/fixtures/scss/bootstrap.scss'],
tasks: ['sass']
},
less: {
files: ['test/fixtures/less/bootstrap.less'],
tasks: ['less']
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js',
singleRun: true
},
watch: {
configFile: 'test/karma.conf.js',
singleRun: false
}
},
jasmine_node: {
specNameMatcher: "Spec", // load only specs containing specNameMatcher
projectRoot: "test/new-server",
requirejs: false,
forceExit: true,
jUnit: {
report: false,
savePath: "./build/reports/jasmine/",
useDotNotation: true,
consolidate: true
}
},
/**
*
*
* Fixture stuff
*
*/
less: {
development: {
files: {
"<%= dirs.css %>/bootstrap-less.css": "<%= dirs.less %>/bootstrap.less"
}
}
},
stylus: {
development: {
files: {
"<%= dirs.css %>/bootstrap-stylus.css": "<%= dirs.stylus %>/bootstrap.styl"
}
}
},
sass: {
development: {
files: {
"<%= dirs.css %>/bootstrap-scss.css": "<%= dirs.scss %>/bootstrap.scss"
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-karma');
// Default task.
grunt.registerTask('default', ['jasmine_node']);
grunt.registerTask('test', ['karma:unit', 'jasmine_node']);
};