forked from theonion/videojs-vast-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
79 lines (69 loc) · 1.75 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
'use strict';
var specs = "spec/*Spec.js",
helpers = "spec/*Helpers.js";
var _ = require('lodash');
var desireds = require('./spec/desireds.js');
var gruntConfig = {
env: {
// dynamically filled
},
jshint: {
ignore_warning: {
options: {
'-W083': true,
},
src: ['videojs.vast.js', specs],
},
},
jasmine: {
src: 'videojs.vast.js',
options: {
specs: specs,
helpers: helpers,
vendor: [
"http://vjs.zencdn.net/4.4.3/video.js",
"lib/videojs-contrib-ads/video.ads.js",
"lib/vast-client.js"
]
}
},
simplemocha: {
sauce: {
options: {
timeout: 60000,
reporter: "spec"
},
src: ["spec/sauce-wd.js"]
}
},
concurrent: {
"test-sauce": []
},
watch: {
scripts: {
files: ['*.js', 'spec/*.js'],
tasks: ['jshint', 'jasmine']
},
}
};
_(desireds).each(function(desired, key) {
gruntConfig.env[key] = {
DESIRED: JSON.stringify(desired)
};
gruntConfig.concurrent['test-sauce'].push('test:sauce:' + key);
});
module.exports = function(grunt) {
grunt.initConfig(gruntConfig);
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-concurrent');
grunt.registerTask('default', ['test:sauce:' + _(desireds).keys().first()]);
_(desireds).each(function(desired, key) {
grunt.registerTask('test:sauce:' + key, ['env:' + key, 'simplemocha:sauce']);
});
grunt.registerTask('default', ['jshint', 'jasmine', 'watch']);
grunt.registerTask('travis', ['jshint', 'jasmine', 'concurrent:test-sauce']);
};