Skip to content

Commit

Permalink
add saucelabs!
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 15, 2014
1 parent a5f074f commit 0dcf28e
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ components
explorations
test/vue.test.js
dist/vue.min.js.gz
coverage
coverage
sauce_connect.log*
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: node_js
node_js:
- "0.10"
- '0.10'
branches:
except:
- dev
- dev
before_install:
- npm install -g grunt-cli component phantomjs casperjs
- npm install -g grunt-cli component phantomjs casperjs
before_script:
- component install
- component install
env:
global:
- secure: Ce9jxsESszOnGyj3A6wILO5W412El9iD/HCHiFgbr8/cSXa4Yt0ZOEZysZeyaBX6IFUCjHtQPLasVgCxijDHrhi7/drmyCE+ksruk/6LJWn9C46PZK6nI+N04iYA2TRnocFllhGbyttpbpxY04smCmGWqXwLppu9nb+VIDkKGmE=
- secure: cZQTby8mGxb4QHi9net2/kK7N2VMOZKPepa+8ob2+jxICSukPgTqGP1iVQWR+tVlU60lFAHpos2o8vQLB4e5Rt5IFEajCr+RppE9xUWxMUulbrXaIrzz1OYA5DvTi/8ZeE6/x0+MpZJT1b/GIqhlrU4QwjjpeJWLwAkv8ysZaEs=
111 changes: 93 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,31 @@ module.exports = function( grunt ) {
}
},

connect: {
test: {
options: {
base: '',
port: 9999
}
}
},

watch: {
options: {
nospawn: true
},
dev: {
files: ['src/**/*.js', './component.json'],
tasks: ['dev', 'instrument']
}
},

coveralls: {
options: {
coverage_dir: 'coverage/'
}
},

karma: {
options: {
frameworks: ['mocha'],
Expand Down Expand Up @@ -54,28 +79,72 @@ module.exports = function( grunt ) {
}
},

coveralls: {
options: {
coverage_dir: 'coverage/'
}
},

watch: {
options: {
nospawn: true
},
dev: {
files: ['src/**/*.js', './component.json'],
tasks: ['dev', 'instrument']
'saucelabs-mocha': {
test: {
options: {
urls: ['http://127.0.0.1:9999/test/unit/runner.html'],
build: process.env.TRAVIS_JOB_ID || Date.now(),
testname: "unit tests",
concurrency: 3,
browsers: [
{
browserName: "chrome",
version: "31",
platform: "Windows 7"
},
{
browserName: "firefox",
version: "26",
platform: "Windows 7"
},
{
browserName: "internet explorer",
platform: "Windows 7",
version: "9"
},
{
browserName: "internet explorer",
platform: "Windows 8",
version: "10"
},
{
browserName: "internet explorer",
platform: "Windows 8.1",
version: "11"
},
{
browserName: "safari",
platform: "OS X 10.8",
version: "6"
},
{
browserName: "safari",
platform: "OS X 10.9",
version: "7"
},
{
browserName: "iphone",
platform: "OS X 10.8",
version: "6.0"
},
{
browserName: "iphone",
platform: "OS X 10.9",
version: "7"
}
]
}
}
}

})

grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-karma-coveralls')
grunt.loadNpmTasks('grunt-saucelabs')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-connect')

// load custom tasks
grunt.file.recurse('tasks', function (path) {
Expand All @@ -92,18 +161,24 @@ module.exports = function( grunt ) {
'casper'
])

grunt.registerTask( 'default', [
'jshint',
'build',
'test'
grunt.registerTask( 'sauce', [
'connect',
'saucelabs-mocha'
])

grunt.registerTask( 'travis', [
'build',
'instrument',
'karma:phantom',
'coveralls',
'casper',
'coveralls'
'sauce'
])

grunt.registerTask( 'default', [
'jshint',
'build',
'test'
])

}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ For more details, guides and documentations, visit [vuejs.org](http://vuejs.org)

## Browser Support

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

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)

## Development

Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,28 @@
"grunt": "~0.4.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-connect": "~0.6.0",
"grunt-karma": "~0.6.2",
"grunt-karma-coveralls": "~2.3.0",
"grunt-saucelabs": "~4.1.2",
"gulp-component": "~0.1.4",
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs",
"jshint-stylish": "~0.1.4",
"semver": "~2.2.1",
"shell-task": "~0.1.1",
"map-stream": "0.0.4",
"uglify-js": "~2.4.8",
"vinyl-fs": "git://github.com/wearefractal/vinyl-fs",
"gulp-component": "~0.1.4",
"grunt-karma": "~0.6.2",
"karma": "~0.10.9",
"karma-mocha": "~0.1.1",
"karma-coverage": "~0.1.4",
"karma-script-launcher": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.1",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-safari-launcher": "~0.1.1",
"karma-requirejs": "~0.2.1",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-coffee-preprocessor": "~0.1.2",
"karma-phantomjs-launcher": "~0.1.1",
"karma": "~0.10.9",
"karma-mocha": "~0.1.1",
"karma-coverage": "~0.1.4",
"karma-safari-launcher": "~0.1.1",
"grunt-karma-coveralls": "~2.3.0"
"karma-coffee-preprocessor": "~0.1.2"
}
}
7 changes: 6 additions & 1 deletion test/unit/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
<script src="specs/misc.js"></script>

<script>
mocha.run()
onload = function () {
var runner = mocha.run()
runner.on('end', function () {
window.mochaResults = runner.stats
})
}
</script>
</body>
</html>
4 changes: 4 additions & 0 deletions test/unit/specs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ describe('UNIT: Utils', function () {
})

describe('log', function () {

if (!window.console) return

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

describe('warn', function () {

if (!window.console) return

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

0 comments on commit 0dcf28e

Please sign in to comment.