Skip to content

Commit 0dcf28e

Browse files
committedJan 15, 2014
add saucelabs!
1 parent a5f074f commit 0dcf28e

File tree

7 files changed

+128
-37
lines changed

7 files changed

+128
-37
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ components
55
explorations
66
test/vue.test.js
77
dist/vue.min.js.gz
8-
coverage
8+
coverage
9+
sauce_connect.log*

‎.travis.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
language: node_js
22
node_js:
3-
- "0.10"
3+
- '0.10'
44
branches:
55
except:
6-
- dev
6+
- dev
77
before_install:
8-
- npm install -g grunt-cli component phantomjs casperjs
8+
- npm install -g grunt-cli component phantomjs casperjs
99
before_script:
10-
- component install
10+
- component install
11+
env:
12+
global:
13+
- secure: Ce9jxsESszOnGyj3A6wILO5W412El9iD/HCHiFgbr8/cSXa4Yt0ZOEZysZeyaBX6IFUCjHtQPLasVgCxijDHrhi7/drmyCE+ksruk/6LJWn9C46PZK6nI+N04iYA2TRnocFllhGbyttpbpxY04smCmGWqXwLppu9nb+VIDkKGmE=
14+
- secure: cZQTby8mGxb4QHi9net2/kK7N2VMOZKPepa+8ob2+jxICSukPgTqGP1iVQWR+tVlU60lFAHpos2o8vQLB4e5Rt5IFEajCr+RppE9xUWxMUulbrXaIrzz1OYA5DvTi/8ZeE6/x0+MpZJT1b/GIqhlrU4QwjjpeJWLwAkv8ysZaEs=

‎Gruntfile.js

+93-18
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ module.exports = function( grunt ) {
2020
}
2121
},
2222

23+
connect: {
24+
test: {
25+
options: {
26+
base: '',
27+
port: 9999
28+
}
29+
}
30+
},
31+
32+
watch: {
33+
options: {
34+
nospawn: true
35+
},
36+
dev: {
37+
files: ['src/**/*.js', './component.json'],
38+
tasks: ['dev', 'instrument']
39+
}
40+
},
41+
42+
coveralls: {
43+
options: {
44+
coverage_dir: 'coverage/'
45+
}
46+
},
47+
2348
karma: {
2449
options: {
2550
frameworks: ['mocha'],
@@ -54,28 +79,72 @@ module.exports = function( grunt ) {
5479
}
5580
},
5681

57-
coveralls: {
58-
options: {
59-
coverage_dir: 'coverage/'
60-
}
61-
},
62-
63-
watch: {
64-
options: {
65-
nospawn: true
66-
},
67-
dev: {
68-
files: ['src/**/*.js', './component.json'],
69-
tasks: ['dev', 'instrument']
82+
'saucelabs-mocha': {
83+
test: {
84+
options: {
85+
urls: ['http://127.0.0.1:9999/test/unit/runner.html'],
86+
build: process.env.TRAVIS_JOB_ID || Date.now(),
87+
testname: "unit tests",
88+
concurrency: 3,
89+
browsers: [
90+
{
91+
browserName: "chrome",
92+
version: "31",
93+
platform: "Windows 7"
94+
},
95+
{
96+
browserName: "firefox",
97+
version: "26",
98+
platform: "Windows 7"
99+
},
100+
{
101+
browserName: "internet explorer",
102+
platform: "Windows 7",
103+
version: "9"
104+
},
105+
{
106+
browserName: "internet explorer",
107+
platform: "Windows 8",
108+
version: "10"
109+
},
110+
{
111+
browserName: "internet explorer",
112+
platform: "Windows 8.1",
113+
version: "11"
114+
},
115+
{
116+
browserName: "safari",
117+
platform: "OS X 10.8",
118+
version: "6"
119+
},
120+
{
121+
browserName: "safari",
122+
platform: "OS X 10.9",
123+
version: "7"
124+
},
125+
{
126+
browserName: "iphone",
127+
platform: "OS X 10.8",
128+
version: "6.0"
129+
},
130+
{
131+
browserName: "iphone",
132+
platform: "OS X 10.9",
133+
version: "7"
134+
}
135+
]
136+
}
70137
}
71138
}
72139

73140
})
74141

75142
grunt.loadNpmTasks('grunt-karma')
76143
grunt.loadNpmTasks('grunt-karma-coveralls')
144+
grunt.loadNpmTasks('grunt-saucelabs')
77145
grunt.loadNpmTasks('grunt-contrib-watch')
78146
grunt.loadNpmTasks('grunt-contrib-jshint')
147+
grunt.loadNpmTasks('grunt-contrib-connect')
79148

80149
// load custom tasks
81150
grunt.file.recurse('tasks', function (path) {
@@ -92,18 +161,24 @@ module.exports = function( grunt ) {
92161
'casper'
93162
])
94163

95-
grunt.registerTask( 'default', [
96-
'jshint',
97-
'build',
98-
'test'
164+
grunt.registerTask( 'sauce', [
165+
'connect',
166+
'saucelabs-mocha'
99167
])
100168

101169
grunt.registerTask( 'travis', [
102170
'build',
103171
'instrument',
104172
'karma:phantom',
173+
'coveralls',
105174
'casper',
106-
'coveralls'
175+
'sauce'
176+
])
177+
178+
grunt.registerTask( 'default', [
179+
'jshint',
180+
'build',
181+
'test'
107182
])
108183

109184
}

‎README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ For more details, guides and documentations, visit [vuejs.org](http://vuejs.org)
1616

1717
## Browser Support
1818

19-
- Most Webkit/Blink-based browsers
20-
- Firefox 4+
21-
- IE9+ (IE9 needs [classList polyfill](https://github.com/remy/polyfills/blob/master/classList.js) and doesn't support transitions)
19+
[![Selenium Test Status](https://saucelabs.com/browser-matrix/vuejs.svg)](https://saucelabs.com/u/vuejs)
20+
21+
Vue.js supports ECMAScript 5 compliant browsers, essentially IE9+ (IE9 needs [classList polyfill](https://github.com/remy/polyfills/blob/master/classList.js) and doesn't support transitions)
2222

2323
## Development
2424

‎package.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,28 @@
2525
"grunt": "~0.4.2",
2626
"grunt-contrib-watch": "~0.5.3",
2727
"grunt-contrib-jshint": "~0.8.0",
28+
"grunt-contrib-connect": "~0.6.0",
29+
"grunt-karma": "~0.6.2",
30+
"grunt-karma-coveralls": "~2.3.0",
31+
"grunt-saucelabs": "~4.1.2",
32+
"gulp-component": "~0.1.4",
33+
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs",
2834
"jshint-stylish": "~0.1.4",
2935
"semver": "~2.2.1",
3036
"shell-task": "~0.1.1",
3137
"map-stream": "0.0.4",
3238
"uglify-js": "~2.4.8",
33-
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs",
34-
"gulp-component": "~0.1.4",
35-
"grunt-karma": "~0.6.2",
39+
"karma": "~0.10.9",
40+
"karma-mocha": "~0.1.1",
41+
"karma-coverage": "~0.1.4",
3642
"karma-script-launcher": "~0.1.0",
43+
"karma-phantomjs-launcher": "~0.1.1",
3744
"karma-chrome-launcher": "~0.1.2",
3845
"karma-firefox-launcher": "~0.1.3",
46+
"karma-safari-launcher": "~0.1.1",
3947
"karma-requirejs": "~0.2.1",
4048
"karma-html2js-preprocessor": "~0.1.0",
4149
"karma-jasmine": "~0.1.5",
42-
"karma-coffee-preprocessor": "~0.1.2",
43-
"karma-phantomjs-launcher": "~0.1.1",
44-
"karma": "~0.10.9",
45-
"karma-mocha": "~0.1.1",
46-
"karma-coverage": "~0.1.4",
47-
"karma-safari-launcher": "~0.1.1",
48-
"grunt-karma-coveralls": "~2.3.0"
50+
"karma-coffee-preprocessor": "~0.1.2"
4951
}
5052
}

‎test/unit/runner.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434
<script src="specs/misc.js"></script>
3535

3636
<script>
37-
mocha.run()
37+
onload = function () {
38+
var runner = mocha.run()
39+
runner.on('end', function () {
40+
window.mochaResults = runner.stats
41+
})
42+
}
3843
</script>
3944
</body>
4045
</html>

‎test/unit/specs/utils.js

+4
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ describe('UNIT: Utils', function () {
250250
})
251251

252252
describe('log', function () {
253+
254+
if (!window.console) return
253255

254256
it('should only log in debug mode', function () {
255257
// overwrite log temporarily
@@ -274,6 +276,8 @@ describe('UNIT: Utils', function () {
274276
})
275277

276278
describe('warn', function () {
279+
280+
if (!window.console) return
277281

278282
it('should only warn when not in silent mode', function () {
279283
config.silent = true

0 commit comments

Comments
 (0)