Skip to content

Coverage report doesn't show for Vue components that don't have executable JS code #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saifulss opened this issue Jan 14, 2019 · 1 comment · Fixed by #152
Closed
Labels

Comments

@saifulss
Copy link

When running Jest for test coverage, a Vue component (Single File Component) won't show up in the coverage report unless it has at least 1 line of executable JS code.

An example of executable JS code, is adding a method to the component (even if you don't use the method). Once there's at least 1 line, the file will show up in the coverage report.

I use the coverage report to see which files have yet to be covered by the coverage report. Even the simple Vue components with no executable JS code.

@danielistyo
Copy link

This bug appear again in my code.
"vue-jest": "3.0.5",

My component code:

<template>
	<div class="back-to-top" @click="backToTop">
		<img v-lazy="'/general/img/icons/ic_voucher_back_to_top.svg'" />
	</div>
</template>

<script>
export default {
	props: {
		backToTop: {
			type: Function,
			required: true
		}
	}
};
</script>

It doesn't have coverage report. If I add one method, I will have coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants