Vue-jest: Need support for code splitting

Created on 8 Nov 2017  路  5Comments  路  Source: vuejs/vue-jest

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?

Most helpful comment

Vote for this. I'm experiencing the same issue.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xereda picture xereda  路  4Comments

yohodopo picture yohodopo  路  4Comments

ccamarat picture ccamarat  路  7Comments

rmartins90 picture rmartins90  路  6Comments

mazipan picture mazipan  路  10Comments