forked from GianlucaGuarini/Tocca.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
114 lines (110 loc) · 2.18 KB
/
Copy pathGruntfile.js
File metadata and controls
114 lines (110 loc) · 2.18 KB
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
module.exports = function(grunt) {
'use strict'
var browsers = [{
browserName: 'firefox',
platform: 'Windows 7'
}, {
browserName: 'googlechrome',
platform: 'Windows 7'
}, {
browserName: 'safari',
platform: 'Windows 7'
}, {
platform: 'OS X 10.9',
deviceName: 'iPhone',
browserName: 'iphone',
version: '8.1'
}, {
platform: 'OS X 10.9',
deviceName: 'iPad',
browserName: 'ipad',
version: '8.1'
}, {
platform: 'Linux',
deviceName: 'Android',
browserName: 'android',
version: '4.1'
},{
platform: 'Linux',
deviceName: 'Android',
browserName: 'android',
version: '5.0'
}]
grunt.loadNpmTasks('grunt-mocha')
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-saucelabs')
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
eqeqeq: true,
eqnull: true,
browser: true,
strict: true,
unused: true,
asi: true,
quotmark: 'single'
},
files: {
src: ['Tocca.js', 'Gruntfile.js']
}
},
connect: {
server: {
options: {
base: '.',
port: 8888
}
}
},
'saucelabs-mocha': {
all: {
options: {
urls: [
'http://127.0.0.1:8888/test/tests.html'
],
username: 'Toccajs',
key: '68b9e417-3aec-4f8e-9b02-b9417029eca8',
browsers: browsers,
build: process.env.TRAVIS_JOB_ID,
testname: 'Tocca.js tests',
throttled: 3,
sauceConfig: {
'video-upload-on-pass': false
}
}
}
},
mocha: {
all: {
src: ['http://127.0.0.1:8888/test/tests.html'],
options: {
run: true,
reporter: 'Spec',
log: true,
timeout: 10000,
mocha: {
ignoreLeaks: false
}
},
},
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> || <%= pkg.author %> */\n'
},
build: {
src: 'Tocca.js',
dest: 'Tocca.min.js'
}
}
})
// test js files
grunt.registerTask('test', ['jshint', 'mocha'])
grunt.registerTask('sauce', ['connect', 'saucelabs-mocha'])
// Default task.
grunt.registerTask('default', ['jshint', 'mocha', 'uglify'])
}