Open Polluux opened 2 months ago
Here's how the component looks like when it's transpiled.
I don't think this will work with any Javascript code coverage tool.
Okay so based on your answer I managed to find a quick workaround for this case.
Insead of :
v-model:nameproperty="data"
@update:nameproperty="onData"
...
function onData() {
// do
}
I'd write :
:nameproperty="data"
@update:nameproperty="onData"
...
function onData(e) {
nameproperty.value = e;
// do
}
Behavior looks the same and coverage is working as expected. Still feel a bit sad to not be able to use the "full power" of Vue.
This is a sourcemap issue.
Following is the coverage of transpiled code:
You can see the wrong maping
That's why the uncovered position is started from line 1
Describe the bug
Coverage is misbehaving when a custom component has a
v-model
and a@update
listener on the same property.Ex:
Reproduction
Here is a github repository with documentation and reproduction case :
https://github.com/Polluux/demo-v8-coverage-issue-vmodel-update
System Info
Used Package Manager
npm
Validations