Skip to content

Commit 4952874

Browse files
committed
remove code for vuejs#455
1 parent 9e9a863 commit 4952874

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

Diff for: packages/test-utils/src/set-watchers-to-sync.js

-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { VUE_VERSION } from './consts'
2-
31
function setDepsSync (dep) {
42
dep.subs.forEach(setWatcherSync)
53
}
@@ -26,17 +24,4 @@ export function setWatchersToSync (vm) {
2624
setWatcherSync(vm._watcher)
2725

2826
vm.$children.forEach(setWatchersToSync)
29-
30-
// preventing double registration
31-
if (!vm.$_vueTestUtils_updateInSetWatcherSync) {
32-
vm.$_vueTestUtils_updateInSetWatcherSync = vm._update
33-
vm._update = function (vnode, hydrating) {
34-
this.$_vueTestUtils_updateInSetWatcherSync(vnode, hydrating)
35-
if (VUE_VERSION >= 2.1 && this._isMounted && this.$options.updated) {
36-
this.$options.updated.forEach((handler) => {
37-
handler.call(this)
38-
})
39-
}
40-
}
41-
}
4227
}

Diff for: test/specs/mounting-options/sync.spec.js

-34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sinon from 'sinon'
21
import { describeWithShallowAndMount } from '~resources/utils'
32

43
describeWithShallowAndMount('options.sync', (mountingMethod) => {
@@ -111,37 +110,4 @@ describeWithShallowAndMount('options.sync', (mountingMethod) => {
111110
done()
112111
})
113112
})
114-
115-
it('call updated when sync is not false', () => {
116-
const fooSpy = sinon.stub()
117-
const Foo = {
118-
template: '<div>{{ foo }}</div>',
119-
props: ['foo'],
120-
updated () {
121-
fooSpy()
122-
}
123-
}
124-
const spy = sinon.stub()
125-
const TestComponent = {
126-
template: '<div>{{ foo }}<foo :foo="foo" /></div>',
127-
data () {
128-
return {
129-
foo: 'foo'
130-
}
131-
},
132-
updated () {
133-
spy()
134-
}
135-
}
136-
const wrapper = mountingMethod(TestComponent, {
137-
stubs: { foo: Foo },
138-
sync: true
139-
})
140-
expect(spy.notCalled).to.equal(true)
141-
expect(fooSpy.notCalled).to.equal(true)
142-
wrapper.vm.foo = 'bar'
143-
expect(spy.calledOnce).to.equal(true)
144-
expect(fooSpy.calledOnce).to.equal(true)
145-
expect(wrapper.html()).to.equal('<div>bar<div>bar</div></div>')
146-
})
147113
})

0 commit comments

Comments
 (0)