forked from tmaeda1981jp/string-format-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
62 lines (53 loc) · 1.39 KB
/
Copy pathGruntfile.js
File metadata and controls
62 lines (53 loc) · 1.39 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
/*jslint white: true, nomen: true, maxlen: 120, plusplus: true, */
/*global _:false, $:false, define:false, require:false, */
module.exports = function(grunt) {
'use strict';
// Add the grunt-mocha-test tasks.
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
my_target: {
options: {
mangle: true,
compress: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
files: {
'format.min.js': ['format.js']
}
}
},
mochaTest: {
test: {
options: {
// grep: '%b',
reporter: 'spec'
},
src: ['test/format.spec.js']
}
},
mocha_phantomjs: {
options: {
reporter: 'spec'
},
all: ['test/**/*.html']
},
watch: {
mochaTest: {
files: ['format.js', 'test/format.spec.js'],
tasks: ['mochaTest']
},
browserTest: {
files: ['format.js', 'test/format.spec.js'],
tasks: ['mocha_phantomjs']
}
}
});
grunt.registerTask('default', 'mochaTest');
grunt.registerTask('browserTest', 'mocha_phantomjs');
};