-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
executable file
·73 lines (58 loc) · 2.16 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
module.exports = function(grunt) {
'use strict';
// Load the plugins that provide the tasks we specified in package.json
require('load-grunt-tasks')(grunt);
////////////////////////
// Task Configuration //
////////////////////////
grunt.initConfig({
blanket_mocha: {
options: {
run: true,
reporter: 'Min',
// We want a minimum of 70% coverage
threshold: 70
},
files: {
src: 'test/*.html'
}
},
karma : {
options: {
// Configuration options that tell Karma how to run
configFile: 'karma.conf.js',
files: [
// These files are probably going to be included in
// all our tests that we'd write. The files object in
// each individual karma target are added to these.
'node_modules/chai/chai.js',
'node_modules/sinon-chai/lib/sinon-chai.js',
'node_modules/sinon/pkg/sinon.js',
'test/polyfills.js',
// In our case, the test and src files are the
// same for the dev and prod targets so we can include
// them in the global files option here
'js/calculator.js',
'test/calculator-test.js',
// html2js preprocessor takes this file and coverts it
// to a string in our JS when the tests run.
'test/index.html'
]
},
dev: {
// On our local environment we want to test all the things!
browsers: ['Chrome', 'Firefox', 'PhantomJS']
},
// For production, that is to say, our CI environment, we'll
// run tests once in PhantomJS browser.
prod: {
singleRun: true,
browsers: ['PhantomJS']
}
}
});
///////////
// Tasks //
///////////
grunt.registerTask('default', ['blanket_mocha']);
};