-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
111 lines (109 loc) · 2.12 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.initConfig({
connect: {
server: {
options: {
base: '',
port: 9999,
},
},
},
jsonlint: {
all: {
src: ['jsdoc.json', 'test/_fixtures_/*.json'],
options: {
formatter: 'prose',
},
},
},
// Client-side mocha tests
mocha: {
test: {
src: ['test/client/index.html'],
options: {
log: true,
logErrors: true,
mocha: {
ui: 'tdd',
},
reporter: 'List',
run: true,
},
},
},
'saucelabs-mocha': {
tests: {
options: {
urls: ['http://localhost:9999/test/client/index.html'],
tunnelTimeout: 5,
build: process.env.TRAVIS_BUILD_NUMBER || 'dev',
concurrency: 3,
testname: 'jsond-validator',
public: 'public',
browsers: [
{
browserName: 'chrome',
platform: 'Windows 10',
},
{
browserName: 'firefox',
platform: 'Windows 10',
},
{
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
},
{
browserName: 'internet explorer',
platform: 'Windows 10',
},
{
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11.0',
},
{
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10.0',
},
{
browserName: 'chrome',
platform: 'Linux',
},
{
browserName: 'firefox',
platform: 'Linux',
},
{
browserName: 'safari',
platform: 'OS X 10.10',
version: '8.0',
},
],
},
},
},
watch: {
all: {
files: ['lib/**/*.js', 'test/**/*.js', 'test/**/*.json'],
tasks: ['mochaTest', 'jshint'],
},
},
});
grunt.util._.each(
{
default: ['watch'],
dev: ['connect', 'watch'],
saucelabs: ['connect', 'saucelabs-mocha'],
},
function(tasks, alias) {
grunt.registerTask(alias, tasks);
}
);
};