Skip to content

HTML reporter doesn't load project label color config #10141

@hi-ogawa

Description

@hi-ogawa

Describe the bug

Just spotted this is empty on html reporter case

getResolvedProjectLabels: () => {
return []
},

This causes project color from config to be not loaded, e.g.

export default defineConfig({
  test: {
    projects: [
      {
        test: {
          name: {
            label: 'foo',
            color: 'black',
          },
        },
      },
      {
        test: {
          name: {
            label: 'bar',
            color: 'red',
          },
        },
      },
    ],
  },
});
  • vitest --ui
Image
  • vitest --reporter=html
Image

I think we should rework this better so that UI gets more than just serialized root level config. I have a similar needs of wanting to pass per-project browser.traceView to be available uniformly both on UI and HTML reporter in #10102

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-6yspi7fu?file=vite.config.ts

System Info

Stackblitz

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions