1.0.0-beta.24
https://codesandbox.io/s/7307xq2171
Bump @vue/test-utils version from 1.0.0-beta.21 to any later/latest version to reproduce the bug on provided sandbox link.
There shouldn't be any error on console.
TypeError: Cannot read property '$el' of undefined.
This issue does not occur on 1.0.0-beta.21.
It happened to me as well while upgrading from 1.0.0-beta.24 to 1.0.0-beta.25.
While running the tests I get:
● default › should match the snapshot
TypeError: Cannot read property '$el' of undefined
10 |
11 | it('should match the snapshot', () => {
> 12 | expect(vm.$el).toMatchSnapshot()
| ^
13 | })
14 |
15 | it('should have link to the campaign list page', () => {
at Object.<anonymous> (tests/unit/specs/views/NotFound.spec.js:12:15)
I put everything in a gist: https://gist.github.com/rhymes/9972f9259711035156545c00efae73c3
When solve this problem?Thanks
This is caused by the synchronous Transition stub component that Vue Test Utils adds by default. You can turn it off with the stubs options:
mount(TestComponent, {
stubs: {
transition: false
}
})
import ElementUI from 'element-ui'
const localVue = createLocalVue()
localVue.use(ElementUI)

Most helpful comment
This is caused by the synchronous Transition stub component that Vue Test Utils adds by default. You can turn it off with the
stubsoptions: