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
fix: fix incorect coverage reporting (fix #375) #655
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1b5a5ff
refactoring: remove not used option
Demivan 25c7e18
refactoring: reduce amount of coverage info collected
Demivan 3b2d23f
test: add test for checking vue coverage
Demivan 9c8c4a2
chore: fix test name
Demivan 59ab971
Revert "refactoring: reduce amount of coverage info collected"
Demivan 8f07e99
chore: use promisify to wait for result
Demivan b99031a
refactoring: use real file path in fetchCache
Demivan d0c1802
Revert "fix: collect coverage using node inspector (fix #378) (#584)"
Demivan c222fa7
chore: make coverage test move informative
Demivan 0f65f5c
chore: update external packages
Demivan 9403d7a
fix: fix coverage mapping
Demivan 4c5952d
Merge remote-tracking branch 'origin/main' into coverage-map
Demivan 6dde12b
chore: remove extra newline
Demivan f9a4c09
chore: fix typecheck
Demivan 698b67e
chore: add a note about magic number
Demivan 725cb58
chore: skip test that times out
Demivan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import { computed, ref } from 'vue' | ||
|
||
const times = ref(2) | ||
const props = defineProps<{ count: number }>() | ||
|
||
const result = computed(() => props.count * times.value) | ||
|
||
defineExpose(props) | ||
</script> | ||
|
||
<template> | ||
<div>{{ count }} x {{ times }} = {{ result }}</div> | ||
<button @click="times += 1"> | ||
x1 | ||
</button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module "*.vue" { | ||
import type { DefineComponent } from "vue" | ||
const component: DefineComponent<{}, {}, any> | ||
export default component | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`vue 3 coverage 1`] = ` | ||
"<div>4 x 2 = 8</div> | ||
<button> x1 </button>" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @vitest-environment happy-dom | ||
*/ | ||
|
||
import { expect, test } from 'vitest' | ||
import { mount } from '@vue/test-utils' | ||
import Hello from '../src/Hello.vue' | ||
|
||
test('vue 3 coverage', async() => { | ||
expect(Hello).toBeTruthy() | ||
|
||
const wrapper = mount(Hello, { | ||
props: { | ||
count: 4, | ||
}, | ||
}) | ||
|
||
expect(wrapper.text()).toContain('4 x 2 = 8') | ||
expect(wrapper.html()).toMatchSnapshot() | ||
|
||
await wrapper.get('button').trigger('click') | ||
|
||
expect(wrapper.text()).toContain('4 x 3 = 12') | ||
|
||
await wrapper.get('button').trigger('click') | ||
|
||
expect(wrapper.text()).toContain('4 x 4 = 16') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
vue(), | ||
], | ||
test: { | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later we should calculate this number based on the length of the arguments, but I am fine to have the magic number for now.