Skip to content

Commit

Permalink
remove code for vuejs#455
Browse files Browse the repository at this point in the history
  • Loading branch information
38elements committed May 31, 2018
1 parent 9e9a863 commit 4952874
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
15 changes: 0 additions & 15 deletions packages/test-utils/src/set-watchers-to-sync.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { VUE_VERSION } from './consts'

function setDepsSync (dep) {
dep.subs.forEach(setWatcherSync)
}
Expand All @@ -26,17 +24,4 @@ export function setWatchersToSync (vm) {
setWatcherSync(vm._watcher)

vm.$children.forEach(setWatchersToSync)

// preventing double registration
if (!vm.$_vueTestUtils_updateInSetWatcherSync) {
vm.$_vueTestUtils_updateInSetWatcherSync = vm._update
vm._update = function (vnode, hydrating) {
this.$_vueTestUtils_updateInSetWatcherSync(vnode, hydrating)
if (VUE_VERSION >= 2.1 && this._isMounted && this.$options.updated) {
this.$options.updated.forEach((handler) => {
handler.call(this)
})
}
}
}
}
34 changes: 0 additions & 34 deletions test/specs/mounting-options/sync.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sinon from 'sinon'
import { describeWithShallowAndMount } from '~resources/utils'

describeWithShallowAndMount('options.sync', (mountingMethod) => {
Expand Down Expand Up @@ -111,37 +110,4 @@ describeWithShallowAndMount('options.sync', (mountingMethod) => {
done()
})
})

it('call updated when sync is not false', () => {
const fooSpy = sinon.stub()
const Foo = {
template: '<div>{{ foo }}</div>',
props: ['foo'],
updated () {
fooSpy()
}
}
const spy = sinon.stub()
const TestComponent = {
template: '<div>{{ foo }}<foo :foo="foo" /></div>',
data () {
return {
foo: 'foo'
}
},
updated () {
spy()
}
}
const wrapper = mountingMethod(TestComponent, {
stubs: { foo: Foo },
sync: true
})
expect(spy.notCalled).to.equal(true)
expect(fooSpy.notCalled).to.equal(true)
wrapper.vm.foo = 'bar'
expect(spy.calledOnce).to.equal(true)
expect(fooSpy.calledOnce).to.equal(true)
expect(wrapper.html()).to.equal('<div>bar<div>bar</div></div>')
})
})

0 comments on commit 4952874

Please sign in to comment.