This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
/
Gruntfile.js
126 lines (113 loc) · 3.1 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
module.exports = function(grunt) {
var grep = grunt.option('grep'),
mochaArgs = grep ? '?grep=' + grep : '';
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: [
'src/**/*.js'
]
},
clean: ['build'],
'phoenix-build': {
dev: {
options: {
lumbarFile: 'build.json',
build: true,
output: 'build/dev',
sourceMap: true
}
}
},
connect: {
server: {
options: {
base: 'build/dev',
hostname: '*',
port: 9999
}
}
},
'mocha_phantomjs': {
options: {
reporter: 'dot'
},
quick: {
options: {
urls: [
'http://localhost:9999/jquery/test.html' + mochaArgs,
'http://localhost:9999/zepto/test.html' + mochaArgs
]
}
},
legacy: {
options: {
urls: [
'http://localhost:9999/jquery-backbone-1-0/test.html' + mochaArgs,
'http://localhost:9999/zepto-backbone-1-0/test.html' + mochaArgs
]
}
}
},
'saucelabs-mocha': {
options: {
testname: 'thorax',
build: process.env.TRAVIS_JOB_ID,
tunnelArgs: [
'--verbose'
]
},
jquery: {
options: {
tags: ['jquery'],
urls: [
'http://localhost:9999/jquery/test.html',
'http://localhost:9999/jquery-backbone-1-0/test.html'
],
browsers: [
{browserName: 'chrome'},
{browserName: 'firefox'},
{browserName: 'safari', version: 7, platform: 'OS X 10.9'},
{browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
{browserName: 'internet explorer', version: 8, platform: 'XP'}
]
}
},
zepto: {
options: {
tags: ['zepto'],
urls: [
'http://localhost:9999/zepto/test.html'
],
browsers: [
{browserName: 'chrome'},
{browserName: 'firefox'},
{browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'}
]
}
}
},
watch: {
scripts: {
options: {
atBegin: true
},
files: ['src/**/*.js', 'test/**/*.js'],
tasks: ['jshint', 'phoenix-build:dev', 'mocha_phantomjs:quick', 'fruit-loops:test']
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('phoenix-build');
grunt.loadTasks('tasks');
grunt.registerTask('sauce', process.env.SAUCE_USERNAME ? ['saucelabs-mocha:zepto', 'saucelabs-mocha:jquery'] : []);
grunt.registerTask('test', ['clean', 'connect', 'jshint', 'phoenix-build', 'fruit-loops:test', 'mocha_phantomjs', 'sauce']);
grunt.registerTask('dev', ['clean', 'connect', 'watch']);
};