Akryum / peeky

A fast and fun test runner for Vite & Node 🐈️ Powered by Vite ⚡️
https://peeky.dev
MIT License
681 stars 17 forks source link

Coverage report not generated #70

Closed victorlmneves closed 2 years ago

victorlmneves commented 2 years ago

I'm testing Peeky and I setup it to generate the coverage report as described in the docs [https://peeky.dev/guide/config.html#coverageoptions] but the folder isn't created nor the files

This is how I have it on my vite.config file

export default defineConfig(({ mode }) => {
    process.env = {
        ...process.env,
        ...loadEnv(mode, process.cwd()),
    };
    const brand = process.env.VITE_APP_BRAND;

    return {
        test: {
            // Peeky options here...
            runtimeEnv: 'dom',
            collectCoverage: true,
        },
        coverageOptions: {
            reportsDirectory: './coverage',
            excludeNodeModules: true,
            exclude: [
              'coverage/**',
            ],
            reporter: ['text', 'html'],
            extension: ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue'],
        },
        ...
   };
});
Akryum commented 2 years ago

By default coverage is disabled. You can enable it with the --coverage flag or with the collectCoverage option.

victorlmneves commented 2 years ago

Hi @Akryum That's what I did on the test object, collectCoverage: true But I also tried to run the task with --coverage flag and it also didn't generate the coverage folder + HTML report files I'm only able to see a kind of resume on the terminal image

Akryum commented 2 years ago

Looks like you are using an older version of peeky.

victorlmneves commented 2 years ago

@Akryum looks like it was an issue with the version 0.12.0 For some reason, it was a little outdated (I have added it last week to the project) I have updated to 0.13.2 and now it's working fine (even the report on the terminal, now it's based on Istanbul and not like on the screenshot)

victorlmneves commented 2 years ago

@Akryum But now it doesn't report *.vue files that don't test as it did before 😔

Akryum commented 2 years ago

https://github.com/bcoe/c8/issues/355

victorlmneves commented 2 years ago

@Akryum I already knew about that issue, but I believe you were using a different tool before as I went to check the changes, and C8 was added now. But yeah, looks like I need to wait for them to fix it as I don't have the knowledge to do it. I just mention it because I did a POC with Peeky and Vitest to choose one to add to the project that we are starting and the team has pointed it as an extra point compared to Vitest to have on the report, Vue files that didn't have a test. Thanks