Skip to content

Commit 000433c

Browse files
committed
get tests passing on all suacelab browsers
1 parent cec833a commit 000433c

File tree

6 files changed

+29
-19
lines changed

6 files changed

+29
-19
lines changed

build/karma.sauce.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ var batches = [
4343
browserName: 'internet explorer',
4444
platform: 'Windows 8.1',
4545
version: '11'
46+
},
47+
sl_edge: {
48+
base: 'SauceLabs',
49+
browserName: 'MicrosoftEdge',
50+
platform: 'Windows 10'
4651
}
4752
},
4853
// mobile
@@ -66,6 +71,7 @@ module.exports = function (config) {
6671
var batch = batches[process.argv[4] || 0]
6772

6873
config.set(Object.assign(base, {
74+
singleRun: true,
6975
browsers: Object.keys(batch),
7076
customLaunchers: batch,
7177
reporters: ['progress', 'saucelabs'],

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@
1414
"dev:test": "karma start build/karma.dev.config.js",
1515
"dev:ssr": "webpack --watch --config build/webpack.ssr.dev.config.js",
1616
"dev:compiler": "webpack --watch --config build/webpack.compiler.dev.config.js",
17-
"test": "npm run lint && flow check && npm run test:cover && npm run test:unit && npm run test:e2e && npm run test:ssr",
18-
"ci": "npm run lint && flow check && npm run test:cover && npm run test:ssr",
1917
"build": "NODE_ENV=production node build/build.js",
20-
"lint": "eslint src build test",
21-
"flow": "flow check",
18+
"build:ssr": "npm run build -- vue.common.js,vue-template-compiler,vue-server-renderer",
19+
"ci": "npm run lint && flow check && npm run test:cover && npm run test:ssr",
20+
"test": "npm run lint && flow check && npm run test:cover && npm run test:unit && npm run test:e2e && npm run test:ssr",
2221
"test:unit": "NODE_ENV=development karma start build/karma.unit.config.js",
2322
"test:cover": "NODE_ENV=development karma start build/karma.cover.config.js",
2423
"test:e2e": "npm run build -- vue.js && node test/e2e/runner.js",
25-
"build:ssr": "npm run build -- vue.common.js,vue-template-compiler,vue-server-renderer",
2624
"test:ssr": "npm run build:ssr && NODE_ENV=development VUE_ENV=server jasmine JASMINE_CONFIG_PATH=test/ssr/jasmine.json",
25+
"test:sauce": "npm run sauce -- 0 && npm run sauce -- 1 && npm run sauce -- 2",
26+
"lint": "eslint src build test",
27+
"flow": "flow check",
28+
"sauce": "NODE_ENV=development karma start build/karma.sauce.config.js",
2729
"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",
2830
"release": "bash build/release.sh"
2931
},
@@ -68,6 +70,7 @@
6870
"karma-jasmine": "^1.0.2",
6971
"karma-phantomjs-launcher": "^1.0.0",
7072
"karma-safari-launcher": "^1.0.0",
73+
"karma-sauce-launcher": "^1.0.0",
7174
"karma-sourcemap-loader": "^0.3.0",
7275
"karma-spec-reporter": "^0.0.26",
7376
"karma-webpack": "^1.7.0",

src/core/util/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const inBrowser =
1313
export const devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__
1414

1515
// UA sniffing for working around browser-specific quirks
16-
const UA = inBrowser && window.navigator.userAgent.toLowerCase()
16+
export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
1717
const isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA)
1818
const iosVersionMatch = UA && isIos && UA.match(/os ([\d_]+)/)
1919
const iosVersion = iosVersionMatch && iosVersionMatch[1].split('_')

src/platforms/web/util/element.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ export function isUnknownElement (tag: string): boolean {
8383
el.constructor === window.HTMLElement
8484
))
8585
} else {
86-
return (unknownElementCache[tag] = (
87-
/HTMLUnknownElement/.test(el.toString()) &&
88-
// Chrome returns unknown for several HTML5 elements.
89-
// https://code.google.com/p/chromium/issues/detail?id=540526
90-
!/^(data|time|rtc|rb)$/.test(tag)
91-
))
86+
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
9287
}
9388
}

test/unit/features/options/components.spec.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue'
2+
import { UA } from 'core/util/env'
23

34
describe('Options components', () => {
45
it('should accept plain object', () => {
@@ -74,10 +75,15 @@ describe('Options components', () => {
7475
expect('Do not use built-in or reserved HTML elements as component').toHaveBeenWarned()
7576
})
7677

77-
it('warn non-existent', () => {
78-
new Vue({
79-
template: '<test></test>'
80-
}).$mount()
81-
expect('Unknown custom element: <test>').toHaveBeenWarned()
82-
})
78+
// the HTMLUnknownElement check doesn't work in Android 4.2
79+
// but since it doesn't support custom elements nor will any dev use it
80+
// as their primary debugging browser, it doesn't really matter.
81+
if (!(UA && /android 4\.2/.test(UA))) {
82+
it('warn non-existent', () => {
83+
new Vue({
84+
template: '<test></test>'
85+
}).$mount()
86+
expect('Unknown custom element: <test>').toHaveBeenWarned()
87+
})
88+
}
8389
})

test/unit/features/transition/transition.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ if (!isIE9) {
389389
expect(vm.$el.children[0].className).toBe('test test-leave')
390390
}).thenWaitFor(nextFrame).then(() => {
391391
expect(vm.$el.children[0].className).toBe('test test-leave-active')
392-
}).thenWaitFor(duration / 2).then(() => {
392+
}).thenWaitFor(10).then(() => {
393393
vm.ok = true
394394
}).then(() => {
395395
expect(spy).toHaveBeenCalled()

0 commit comments

Comments
 (0)