Skip to content

Commit 81c195f

Browse files
committed
fix coverage
1 parent 6ce19be commit 81c195f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/directives/public/for.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ const vFor = {
333333
setTimeout(op, staggerAmount)
334334
} else {
335335
var target = prevEl.nextSibling
336+
/* istanbul ignore if */
336337
if (!target) {
337338
// reset end anchor position in case the position was messed up
338339
// by an external drag-n-drop library.

src/instance/internal/misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export default function (Vue) {
5959
} else {
6060
factory = resolveAsset(this.$options, 'components', value, true)
6161
}
62+
/* istanbul ignore if */
6263
if (!factory) {
6364
return
6465
}

test/unit/specs/util/component_spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ describe('Util - component', function () {
2323
expect(res.id).toBe('foo')
2424
expect(res.dynamic).toBe(true)
2525

26+
// <test is="...">
27+
el = document.createElement('test')
28+
el.setAttribute('is', 'foo')
29+
res = _.checkComponentAttr(el, mockOptions)
30+
expect(res.id).toBe('foo')
31+
expect(res.dynamic).toBeUndefined()
32+
33+
// <test :is="...">
34+
el = document.createElement('test')
35+
el.setAttribute(':is', 'foo')
36+
res = _.checkComponentAttr(el, mockOptions)
37+
expect(res.id).toBe('foo')
38+
expect(res.dynamic).toBe(true)
39+
2640
// custom element, not defined
2741
el = document.createElement('test')
2842
res = _.checkComponentAttr(el, mockOptions)

0 commit comments

Comments
 (0)