Skip to content

Commit e0ca894

Browse files
committed
test: improve coverage
1 parent 92a5e93 commit e0ca894

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Diff for: src/core/instance/render.js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function initRender (vm: Component) {
4949
// $attrs & $listeners are exposed for easier HOC creation.
5050
// they need to be reactive so that HOCs using them are always updated
5151
const parentData = parentVnode && parentVnode.data
52+
/* istanbul ignore else */
5253
if (process.env.NODE_ENV !== 'production') {
5354
defineReactive(vm, '$attrs', parentData && parentData.attrs, () => {
5455
!isUpdatingChildComponent && warn(`$attrs is readonly.`, vm)

Diff for: src/platforms/web/runtime/components/transition-group.js

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export default {
127127
if (!hasTransition) {
128128
return false
129129
}
130+
/* istanbul ignore if */
130131
if (this._hasMove) {
131132
return this._hasMove
132133
}

Diff for: test/unit/features/directives/on.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -695,4 +695,18 @@ describe('Directive v-on', () => {
695695
expect(mouseup.calls.count()).toBe(1)
696696
expect(mousedown.calls.count()).toBe(1)
697697
})
698+
699+
it('warn object syntax with modifier', () => {
700+
new Vue({
701+
template: `<button v-on.self="{}"></button>`
702+
}).$mount()
703+
expect(`v-on without argument does not support modifiers`).toHaveBeenWarned()
704+
})
705+
706+
it('warn object syntax with non-object value', () => {
707+
new Vue({
708+
template: `<button v-on="123"></button>`
709+
}).$mount()
710+
expect(`v-on without argument expects an Object value`).toHaveBeenWarned()
711+
})
698712
})

0 commit comments

Comments
 (0)