-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
81 lines (73 loc) · 2.5 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
var merge = require('lodash.merge'),
fs = require('fs');
module.exports = function(grunt) {
'use strict';
var pkg = grunt.file.readJSON('package.json');
(function () {
var taskName;
for(taskName in pkg.devDependencies) {
if(taskName.substring(0, 6) === 'grunt-') {
grunt.loadNpmTasks(taskName);
}
}
})();
grunt.initConfig({
destDir: 'espowered_tests',
clean: {
power_assert: ['<%= destDir %>/']
},
espower: {
power_assert: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'test/', // Src matches are relative to this path.
src: ['power_assert/**/*.js'], // Actual pattern(s) to match.
dest: '<%= destDir %>/', // Destination path prefix.
ext: '.js' // Dest filepaths will have this extension.
},
]
}
},
mochaTest: {
espower_loader: {
options: {
ui: 'tdd',
require: 'intelli-espower-loader'
},
src: ['test/power_assert/*.js']
},
normal_assert: {
options: { ui: 'tdd' },
src: ['test/normal_assert/*.js']
},
mocha_expect: {
options: { ui: 'bdd' },
src: ['test/mocha_expect/*.js']
},
power_assert: {
options: { ui: 'tdd' },
src: ['<%= destDir %>/**/*.js']
}
},
watch: {
normal_assert: {
files: ['test/normal_assert/*.js'],
tasks: ['normal_assert']
},
mocha_expect: {
files: ['test/mocha_expect/*.js'],
tasks: ['mocha_expect']
},
power_assert: {
files: ['test/power_assert/*.js'],
tasks: ['power_assert']
}
},
});
grunt.registerTask('espower_loader', ['mochaTest:espower_loader']);
grunt.registerTask('normal_assert', ['mochaTest:normal_assert']);
grunt.registerTask('mocha_expect', ['mochaTest:mocha_expect']);
grunt.registerTask('power_assert', ['clean:power_assert', 'espower:power_assert', 'mochaTest:power_assert']);
grunt.registerTask('default', ['espower_loader']);
};