Description
Related plugins
Describe the bug
In 4.5.2 and below components with v-if
would have 100% test coverage, now with 4.6.0 and above they will report the first line of the Vue component (<template>
) as not being covered in tests.
I've made the min-repro as simple as possible, it boils down to this:
Example:
<template>
<div v-if="true"></div>
</template>
<script>
export default {
name: 'App'
};
</script>
import { shallowMount } from '@vue/test-utils';
import App from '../../src/App.vue';
describe('App.vue', () => {
test('Shallow mount', async () => {
const wrapper = shallowMount(App);
expect(true)
.toEqual(true);
});
});
Reproduction
https://github.com/TheJaredWilcurt/vite-plugin-vue-min-repro
Steps to reproduce
- clone repo
npm install
npm t
System Info
Tested on Node 20 and 21, Ubuntu 22.04 LTS and also GHA.
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.