mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-02 12:07:39 +08:00
get tests passing on all suacelab browsers
This commit is contained in:
parent
cec833a9e8
commit
000433c878
@ -43,6 +43,11 @@ var batches = [
|
|||||||
browserName: 'internet explorer',
|
browserName: 'internet explorer',
|
||||||
platform: 'Windows 8.1',
|
platform: 'Windows 8.1',
|
||||||
version: '11'
|
version: '11'
|
||||||
|
},
|
||||||
|
sl_edge: {
|
||||||
|
base: 'SauceLabs',
|
||||||
|
browserName: 'MicrosoftEdge',
|
||||||
|
platform: 'Windows 10'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// mobile
|
// mobile
|
||||||
@ -66,6 +71,7 @@ module.exports = function (config) {
|
|||||||
var batch = batches[process.argv[4] || 0]
|
var batch = batches[process.argv[4] || 0]
|
||||||
|
|
||||||
config.set(Object.assign(base, {
|
config.set(Object.assign(base, {
|
||||||
|
singleRun: true,
|
||||||
browsers: Object.keys(batch),
|
browsers: Object.keys(batch),
|
||||||
customLaunchers: batch,
|
customLaunchers: batch,
|
||||||
reporters: ['progress', 'saucelabs'],
|
reporters: ['progress', 'saucelabs'],
|
||||||
|
13
package.json
13
package.json
@ -14,16 +14,18 @@
|
|||||||
"dev:test": "karma start build/karma.dev.config.js",
|
"dev:test": "karma start build/karma.dev.config.js",
|
||||||
"dev:ssr": "webpack --watch --config build/webpack.ssr.dev.config.js",
|
"dev:ssr": "webpack --watch --config build/webpack.ssr.dev.config.js",
|
||||||
"dev:compiler": "webpack --watch --config build/webpack.compiler.dev.config.js",
|
"dev:compiler": "webpack --watch --config build/webpack.compiler.dev.config.js",
|
||||||
"test": "npm run lint && flow check && npm run test:cover && npm run test:unit && npm run test:e2e && npm run test:ssr",
|
|
||||||
"ci": "npm run lint && flow check && npm run test:cover && npm run test:ssr",
|
|
||||||
"build": "NODE_ENV=production node build/build.js",
|
"build": "NODE_ENV=production node build/build.js",
|
||||||
"lint": "eslint src build test",
|
"build:ssr": "npm run build -- vue.common.js,vue-template-compiler,vue-server-renderer",
|
||||||
"flow": "flow check",
|
"ci": "npm run lint && flow check && npm run test:cover && npm run test:ssr",
|
||||||
|
"test": "npm run lint && flow check && npm run test:cover && npm run test:unit && npm run test:e2e && npm run test:ssr",
|
||||||
"test:unit": "NODE_ENV=development karma start build/karma.unit.config.js",
|
"test:unit": "NODE_ENV=development karma start build/karma.unit.config.js",
|
||||||
"test:cover": "NODE_ENV=development karma start build/karma.cover.config.js",
|
"test:cover": "NODE_ENV=development karma start build/karma.cover.config.js",
|
||||||
"test:e2e": "npm run build -- vue.js && node test/e2e/runner.js",
|
"test:e2e": "npm run build -- vue.js && node test/e2e/runner.js",
|
||||||
"build:ssr": "npm run build -- vue.common.js,vue-template-compiler,vue-server-renderer",
|
|
||||||
"test:ssr": "npm run build:ssr && NODE_ENV=development VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
|
"test:ssr": "npm run build:ssr && NODE_ENV=development VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
|
||||||
|
"test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2",
|
||||||
|
"lint": "eslint src build test",
|
||||||
|
"flow": "flow check",
|
||||||
|
"sauce": "NODE_ENV=development karma start build/karma.sauce.config.js",
|
||||||
"bench:ssr": "npm run build:ssr && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js",
|
"bench:ssr": "npm run build:ssr && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToString.js && NODE_ENV=production VUE_ENV=server node benchmarks/ssr/renderToStream.js",
|
||||||
"release": "bash build/release.sh"
|
"release": "bash build/release.sh"
|
||||||
},
|
},
|
||||||
@ -68,6 +70,7 @@
|
|||||||
"karma-jasmine": "^1.0.2",
|
"karma-jasmine": "^1.0.2",
|
||||||
"karma-phantomjs-launcher": "^1.0.0",
|
"karma-phantomjs-launcher": "^1.0.0",
|
||||||
"karma-safari-launcher": "^1.0.0",
|
"karma-safari-launcher": "^1.0.0",
|
||||||
|
"karma-sauce-launcher": "^1.0.0",
|
||||||
"karma-sourcemap-loader": "^0.3.0",
|
"karma-sourcemap-loader": "^0.3.0",
|
||||||
"karma-spec-reporter": "^0.0.26",
|
"karma-spec-reporter": "^0.0.26",
|
||||||
"karma-webpack": "^1.7.0",
|
"karma-webpack": "^1.7.0",
|
||||||
|
@ -13,7 +13,7 @@ export const inBrowser =
|
|||||||
export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
|
export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
|
||||||
|
|
||||||
// UA sniffing for working around browser-specific quirks
|
// UA sniffing for working around browser-specific quirks
|
||||||
const UA = inBrowser && window.navigator.userAgent.toLowerCase()
|
export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
|
||||||
const isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA)
|
const isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA)
|
||||||
const iosVersionMatch = UA && isIos && UA.match(/os ([\d_]+)/)
|
const iosVersionMatch = UA && isIos && UA.match(/os ([\d_]+)/)
|
||||||
const iosVersion = iosVersionMatch && iosVersionMatch[1].split('_')
|
const iosVersion = iosVersionMatch && iosVersionMatch[1].split('_')
|
||||||
|
@ -83,11 +83,6 @@ export function isUnknownElement (tag: string): boolean {
|
|||||||
el.constructor === window.HTMLElement
|
el.constructor === window.HTMLElement
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
return (unknownElementCache[tag] = (
|
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
|
||||||
/HTMLUnknownElement/.test(el.toString()) &&
|
|
||||||
// Chrome returns unknown for several HTML5 elements.
|
|
||||||
// https://code.google.com/p/chromium/issues/detail?id=540526
|
|
||||||
!/^(data|time|rtc|rb)$/.test(tag)
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
import { UA } from 'core/util/env'
|
||||||
|
|
||||||
describe('Options components', () => {
|
describe('Options components', () => {
|
||||||
it('should accept plain object', () => {
|
it('should accept plain object', () => {
|
||||||
@ -74,10 +75,15 @@ describe('Options components', () => {
|
|||||||
expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
|
expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// the HTMLUnknownElement check doesn't work in Android 4.2
|
||||||
|
// but since it doesn't support custom elements nor will any dev use it
|
||||||
|
// as their primary debugging browser, it doesn't really matter.
|
||||||
|
if (!(UA && /android 4\.2/.test(UA))) {
|
||||||
it('warn non-existent', () => {
|
it('warn non-existent', () => {
|
||||||
new Vue({
|
new Vue({
|
||||||
template: '<test></test>'
|
template: '<test></test>'
|
||||||
}).$mount()
|
}).$mount()
|
||||||
expect('Unknown custom element: <test>').toHaveBeenWarned()
|
expect('Unknown custom element: <test>').toHaveBeenWarned()
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
@ -389,7 +389,7 @@ if (!isIE9) {
|
|||||||
expect(vm.$el.children[0].className).toBe('test test-leave')
|
expect(vm.$el.children[0].className).toBe('test test-leave')
|
||||||
}).thenWaitFor(nextFrame).then(() => {
|
}).thenWaitFor(nextFrame).then(() => {
|
||||||
expect(vm.$el.children[0].className).toBe('test test-leave-active')
|
expect(vm.$el.children[0].className).toBe('test test-leave-active')
|
||||||
}).thenWaitFor(duration / 2).then(() => {
|
}).thenWaitFor(10).then(() => {
|
||||||
vm.ok = true
|
vm.ok = true
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
expect(spy).toHaveBeenCalled()
|
expect(spy).toHaveBeenCalled()
|
||||||
|
Loading…
Reference in New Issue
Block a user