This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
/
Gruntfile.js
92 lines (86 loc) · 2.33 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
/*
* grunt-deployinator
* https://github.com/istvan-antal/grunt-deployinator
*
* Copyright (c) 2014 István Miklós Antal
* Licensed under the MIT license.
*/
module.exports = function (grunt) {
'use strict';
var pkg = grunt.file.readJSON('package.json');
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'spec/*.js'
],
options: pkg.jshintConfig,
},
clean: {
coverage: {
src: ['coverage/']
}
},
copy: {
coverage: {
src: ['spec/**'],
dest: 'coverage/'
}
},
instrument: {
files: 'lib/*.js',
options: {
lazy: true,
basePath: 'coverage/'
}
},
mochaTest: {
all: {
options: {
reporter: 'spec',
require: './testHelper.js'
},
src: ['coverage/spec/*.js']
}
},
storeCoverage: {
options: {
dir: 'coverage/reports'
}
},
coverage: {
options: {
thresholds: {
'statements': 100,
'branches': 100,
'lines': 100,
'functions': 100
},
dir: 'coverage/reports',
root: '.'
}
},
makeReport: {
src: 'coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'coverage/reports',
print: 'detail'
}
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-istanbul-coverage');
grunt.registerTask('test',
['clean', 'instrument', 'copy', 'mochaTest', 'storeCoverage', 'makeReport', 'coverage']
);
grunt.registerTask('check', ['jshint', 'test']);
grunt.registerTask('default', ['jshint', 'test']);
};