Skip to content
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

Vue composition api #178

Closed
4 tasks done
lukasbrzobohaty opened this issue Feb 13, 2024 · 3 comments
Closed
4 tasks done

Vue composition api #178

lukasbrzobohaty opened this issue Feb 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@lukasbrzobohaty
Copy link

lukasbrzobohaty commented Feb 13, 2024

Hi,

I have a some issue with instrument code by istanbul in project with vue and composition api.
When I build project then istanbul create three coverage functions with the same path in dist folder.

First function is corect, it is for code in <script setup>. Second function has empty coverage and it is for <template>. The last one is for <style>.

Probably browser take only the last function with empty coverage. Then coverage don't work for these components.

First function:
Snímek obrazovky pořízený 2024-02-13 11-33-47

Second function:
Snímek obrazovky pořízený 2024-02-13 11-34-43

Third function:
Snímek obrazovky pořízený 2024-02-13 11-35-17

Browser coverage:
Snímek obrazovky pořízený 2024-02-13 11-35-42

Reproduction

https://github.com/lukasbrzobohaty/vite-istanbul

Steps to reproduce

  1. npm install
  2. npm run build
  3. npm run start
  4. visit http://localhost:8080, show window.__coverage__ in console and look to .../src/components/HelloWorld.vue

System Info

System:
    OS: Linux 6.5 Linux Mint 21 (Vanessa)
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 16.26 GB / 31.15 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.8.0 - ~/.nvm/versions/node/v18.8.0/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v18.8.0/bin/npm
  Browsers:
    Chrome: 121.0.6167.160
  npmPackages:
    @vitejs/plugin-vue: ^5.0.3 => 5.0.4 
    vite: ^5.1.0 => 5.1.1 
    vite-plugin-istanbul: ^5.0.0 => 5.0.0

Used Package Manager

npm

Logs

No response

Validations

@lukasbrzobohaty lukasbrzobohaty added the bug Something isn't working label Feb 13, 2024
@hugo-daclon
Copy link
Contributor

duplicate #96 (I think)

iFaxity added a commit that referenced this issue Feb 17, 2024
…es (#180)

* fix: add regex for vue SFC to prevent instrumenting style and templates

Single file Components no longer have their html or css instrumented instead of their script

Closes #96 #178 #89

* build: add prepare script to build the package when using a git version

See https://stackoverflow.com/a/57829251

* build: fix dependencies' vulnerabilities

run npm audit fix

* build: bump devDependencies (patch version only)

* fix: instrument both option and composition API

* style: fix sonarlint issues

* revert: reverted changes to dependencies and package.json

Refs: 1e67efc, ea8fa18, 614a88a

* style: changed to single quotes for strings

---------

Co-authored-by: Hugo <[email protected]>
Co-authored-by: Christian Norrman <[email protected]>
@iFaxity
Copy link
Owner

iFaxity commented Feb 17, 2024

Hi @lukasbrzobohaty,

Could you please try the new rc version released with #180 if this fixes your issue?
If there is no problem a release with this will come out to stable within a couple of days.

@iFaxity
Copy link
Owner

iFaxity commented May 5, 2024

Closing due to inactivity.

@iFaxity iFaxity closed this as completed May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants