-
Notifications
You must be signed in to change notification settings - Fork 2
/
gruntfile.js
50 lines (43 loc) · 1.24 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
/*global module:false*/
/**
* Javascript Project Boilerplate
* Version 0.1.0
*/
module.exports = function(grunt) {
"use strict";
var pkg, config;
pkg = grunt.file.readJSON('package.json');
config = {
sources : ['src/companion.js'],
pkg : pkg
};
// Project configuration.
grunt.initConfig({
pkg : config.pkg,
lint : {
files : ['gruntfile.js', 'test/*.js', 'src/*']
},
jshint : {
options : {
jshintrc : 'jshint.json'
},
source : 'src/companion.js'
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task.
grunt.registerTask('default', ['jshint', 'jasmineNode']);
/**
* Runs the server-side jasmine tests
*/
grunt.registerTask('jasmineNode', 'runs jasmine tests intended for jasmine-node', function(){
var exec = require('child_process').exec,
child,
done = grunt.task.current.async(); // Tells Grunt that an async task is complete
child = exec('jasmine-node test/spec/', function(error, stdout, stderr) {
grunt.log.writeln(stdout);
grunt.log.writeln(stderr);
done(error);
});
});
};