-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
123 lines (100 loc) · 3.39 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
119
120
121
122
123
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
"jasmine_node": {
options: {
forceExit: true,
extensions: 'js'
},
spec: ["./spec"],
instrumented: ["./coverage/instrument/spec"]
},
jshint: {
files: ['Gruntfile.js', 'spec/**/*.js']
},
// start - code coverage settings
clean: {
coverage: {
src: ['coverage/']
}
},
instrument: {
files: ['lib/**/*.js'],
options: {
lazy: true,
basePath: 'coverage/instrument/'
}
},
storeCoverage: {
options: {
dir: 'coverage/reports'
}
},
makeReport: {
src: 'coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'coverage/reports',
print: 'detail'
}
},
copy: {
specs: {
files: [
// includes files within path
{expand: true, src: ['spec/**'], dest: './coverage/instrument/'}
]
},
schemas: {
files: [
// includes files within path
{expand: true, src: ['lib/schemas/**'], dest: './coverage/instrument/'}
]
}
},
// end - code coverage settings
coveralls: {
test: {
// LCOV coverage file relevant to every target
src: 'coverage/reports/lcov.info',
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
}
},
jscs: {
src: [
"lib/actions/addPrice.js",
"lib/actions/createProduct.js",
"lib/actions/queryProductVariant.js",
"lib/triggers/queryOrders.js",
"lib/attributeManager.js",
"lib/actions/addVariant.js",
"spec/actions/addPrice.spec.js",
"spec/actions/createProduct.spec.js",
"spec/triggers/queryOrders.spec.js",
"spec/attributeManager.spec.js",
"spec/actions/addVariant.spec.js",
"spec/helpers.spec.js",
"spec/sphere.spec.js"
],
options: {
config: ".jscsrc"
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks("grunt-jscs");
// Default task(s).
grunt.registerTask('default', ['clean', 'jshint', 'jasmine_node:spec']);
grunt.registerTask('test', 'jasmine_node:spec');
grunt.registerTask('coverage', ['clean', 'jscs', 'instrument',
'copy:specs', 'copy:schemas', 'jasmine_node:instrumented', 'storeCoverage', 'makeReport', 'coveralls:test']);
};