-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
47 lines (42 loc) · 1.15 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
module.exports = function (grunt) {
grunt.initConfig({
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['tests/**/*.js']
}
},
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
'public/styles/css/main.css': 'public/styles/less/main.less'
}
}
},
watch: {
less: {
files: 'public/styles/less/*.less',
tasks: 'less'
}
}
});
grunt.registerTask('set_globals', 'sets global variables variable', function () {
global._ = require('underscore');
global.mongoose = require('mongoose');
global.app_path = __dirname;
global.config = require(app_path + '/helpers/general').get_config();
global.helper = require(app_path + '/helpers/tests');
global.Models = require(app_path + '/models')(config.get('TEST_DB'));
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('test', ['set_globals', 'mochaTest']);
};