Skip to content

Commit 978c86a

Browse files
committed
add test for $argments variable
1 parent 7d5abe8 commit 978c86a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/specs/instance/events_spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,24 @@ describe('Instance Events', function () {
237237
expect(vm.a).toBe(1)
238238
})
239239

240+
it('passing $arguments', function () {
241+
new Vue({
242+
el: document.createElement('div'),
243+
template: '<comp @ready="onReady($arguments[1])"></comp>',
244+
methods: {
245+
onReady: spy
246+
},
247+
components: {
248+
comp: {
249+
compiled: function () {
250+
this.$emit('ready', 123, 1234)
251+
}
252+
}
253+
}
254+
})
255+
expect(spy).toHaveBeenCalledWith(1234)
256+
})
257+
240258
describe('attached/detached', function () {
241259

242260
it('in DOM', function () {

0 commit comments

Comments
 (0)