소스 검색

add saucelabs!

Evan You 12 년 전
부모
커밋
0dcf28eb63
7개의 변경된 파일128개의 추가작업 그리고 37개의 파일을 삭제
  1. 2 1
      .gitignore
  2. 8 4
      .travis.yml
  3. 93 18
      Gruntfile.js
  4. 3 3
      README.md
  5. 12 10
      package.json
  6. 6 1
      test/unit/runner.html
  7. 4 0
      test/unit/specs/utils.js

+ 2 - 1
.gitignore

@@ -5,4 +5,5 @@ components
 explorations
 test/vue.test.js
 dist/vue.min.js.gz
-coverage
+coverage
+sauce_connect.log*

+ 8 - 4
.travis.yml

@@ -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=

+ 93 - 18
Gruntfile.js

@@ -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'],
@@ -54,19 +79,61 @@ 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"
+                        }
+                    ]
+                }
             }
         }
 
@@ -74,8 +141,10 @@ module.exports = function( grunt ) {
 
     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) {
@@ -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'
     ])
     
 }

+ 3 - 3
README.md

@@ -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
 

+ 12 - 10
package.json

@@ -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"
   }
 }

+ 6 - 1
test/unit/runner.html

@@ -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 - 0
test/unit/specs/utils.js

@@ -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
@@ -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