This repository was archived by the owner on Mar 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
63 lines (59 loc) · 1.73 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
'use strict';
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-express-server');
// Project configuration.
grunt.initConfig({
express: {
options: {
port: 54815,
output: 'Testserver started an listening on port*'
// Override defaults here
},
test: {
options: {
script: 'test/mocks/mockserver.js'
}
}
},
run: {
coverage: {
exec: 'istanbul cover _mocha -- -R dot "test/**/*.test.js"'
},
openCoverage: {
exec: 'open coverage/lcov-report/index.html'
},
browserify: {
exec: 'browserify -r ./index.js:ec.datamanager.js -s DataManager -o ./build/datamanager.js'
},
uglify: {
exec: 'uglifyjs -o ./build/datamanager.min.js ./build/datamanager.js'
}
},
mochaTest: {
test: {
options: {
reporter: 'dot'
},
src: ['test/**/*.test.js']
}
},
karma: {
test: {
configFile: 'test/karma.conf.js'
}
}
});
// Default task(s).
grunt.registerTask('mockserver', ['express:test']);
grunt.registerTask('mockserver-stop', ['express:test:stop']);
grunt.registerTask('test-backend', 'mochaTest');
grunt.registerTask('test-frontend', ['build', 'mockserver', 'karma:test', 'mockserver-stop']);
grunt.registerTask('build', ['run:browserify', 'run:uglify']);
grunt.registerTask('test', ['test-backend', 'test-frontend']);
grunt.registerTask('coverage', ['coverage-bamboo', 'run:openCoverage']);
grunt.registerTask('coverage-bamboo', ['run:coverage']);
};