Skip to content

Reporter are not taken into account and it always use default reporter #1614

@rkadhi

Description

@rkadhi

Environment

System:
OS: Linux 6.6 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
CPU: (4) x64 AMD EPYC 7763 64-Core Processor
Memory: 3.72 GB / 9.71 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.13.1 - /home/test/.nvm/versions/node/v24.13.1/bin/node
npm: 11.10.1 - /home/test/.nvm/versions/node/v24.13.1/bin/npm
Browsers:
Chrome: 145.0.7632.116
npmPackages:
@vitest/coverage-v8: 4.0.18 => 4.0.18
@vitest/eslint-plugin: 1.6.9 => 1.6.9
vitest: 4.0.18 => 4.0.18
nuxt: 4.3.1 => 4.3.1
@nuxt/test-utils: 4.0.0 => 4.0.0

Reproduction

Config:

import { defineVitestConfig } from '@nuxt/test-utils/config';

export default defineVitestConfig({
  css: {
    preprocessorOptions: {
      sass: {
        api: 'modern'
      }
    }
  },
  esbuild: {
    target: 'esnext',
    minify: false
  },
  optimizeDeps: {
    include: ['vue', 'vuex', 'vuetify', 'axios', 'lodash', 'moment-timezone', 'vue-i18n', '@vue/test-utils'],
    exclude: ['gojs', 'vue-axios', 'highcharts', 'bpmn-js', 'socket.io-client', 'broadcast-channel']
  },
  plugins: [],
  test: {
    globals: true,
    hookTimeout: 30000,
    coverage: {
      reporter: ['html', 'cobertura']
    },
    pool: 'threads',
    environment: 'happy-dom',
    setupFiles: './unitTestUtils/test.config.js',
    server: {
      deps: {
        inline: ['vuetify']
      }
    },
    reporters: ['default', 'junit'],
    outputFile: {
      junit: './junit.xml'
    }
  },
  resolve: {
    alias: {
      'vue-axios': new URL('./unitTestUtils/mocks/vue-axios-mock.js', import.meta.url).pathname,
      gojs: new URL('./unitTestUtils/mocks/gojs-mock.js', import.meta.url).pathname
    }
  }
});

Describe the bug

I have upgraded nuxt utils and vitest both to version 4, I have updated the config but it always takes default reporter into account even I have provided to use Junit and others. Coverage reporters are also not being taken into account.

If I pass it via the CLI (npm run test-coverage --coverage.reporter=cobertura), it works.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions