Hi!
Currently I'm trying to code split my vue component with this way:
// App.vue
<style scoped src="./template/style.scss" lang="scss"></style>
<template src="./template/index.html"></template>
<script src="./script/index.js" type="text/javascript"></script>
And it seems that the vue-jest doesn't render the template. When I mount the component and check the vm.$el.innerHTML it's empty.
I see the comment in the docs:
https://vue-test-utils.vuejs.org/en/guides/testing-SFCs-with-jest.html
Note: vue-jest currently does not support all the features of vue-loader, for example custom block support and style loading. In addition, some webpack-specific features such as code-splitting are not supported either.
So is the problem I faced is regarding the code splitting not supported yet?
Vote for this. I'm experiencing the same issue.
Huge pain for me as I'm working in a project with 1000+ lines components (don't ask me why)
You can use "babel-plugin-dynamic-import-node to make node work with import() statements.
I found this documentation quite useful for helping to solve this problem:
https://facebook.github.io/jest/docs/en/webpack.html
@eddyerburgh this can be closed, I think. Not to be solved in vue-jest
Most helpful comment
Vote for this. I'm experiencing the same issue.