-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
42 lines (33 loc) · 899 Bytes
/
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
require('babel-core/register')({plugins: ['rewire']});
module.exports = function (grunt) {
'use strict';
var testFiles = ['test/unit/**/*.js'];
var srcFiles = ['api/**/*.js'];
var jsFiles = srcFiles.concat(testFiles);
// Set test environment here for cross-platform
process.env.NODE_ENV='test';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
eslint: {
target: jsFiles.concat(['!**/*.tmp.js']),
},
mochaTest: {
test: {
src: testFiles,
},
},
watch: {
js: {
options: { spawn: false, },
files: jsFiles,
tasks: ['default'],
},
},
});
// Load plugins
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', 'test');
grunt.registerTask('lint', 'eslint');
grunt.registerTask('unit-test', 'mochaTest');
grunt.registerTask('test', ['lint', 'unit-test']);
};