reportportal / agent-js-vitest

Agent to integrate Vitest with ReportPortal.
https://www.npmjs.com/package/@reportportal/agent-js-vitest
Apache License 2.0
0 stars 1 forks source link

Reportportal doesnt work than adding coverage #20

Open AugustasV opened 1 month ago

AugustasV commented 1 month ago

Than I run vitest run --coverage --reporter=verbose --reporter=junit --outputFile.junit=junit.xml than I couldn't see anything in reportportal. If I just run vitest run its all good. default config, just with coverage

      include: ['**/*.test.{ts,tsx}'],
      reporters: ['default', new RPReporter(reportPortalConfig)],
      environment: 'jsdom',
      globals: true,
      setupFiles: ['./config/testSetup.ts', "@reportportal/agent-js-vitest/setup"],
      deps: {
        optimizer: {
          web: {
            include: ['vitest-canvas-mock'],
          },
        },
      },
      coverage: {
        // include all files but exclude configs
        all: true,
        provider: 'v8',
        reporter: ['text-summary', 'cobertura', 'lcov', 'html'],
      },
AmsterGet commented 1 month ago

@AugustasV I checked the same case locally, and it seems that Vitest completely overrides the reporters array in case at least one reporter is provided via CLI args. Currently the only way to provide this agent is to create an instance of it in the vitest configuration, it cannot be set as a string parameter via the CLI. So to get it to work, you only need to set reporters through the config file.

I will post a ticket to our backlog to solve the case with specifying the agent via CLI argument.