Skip to content

[@codspeed/vitest-plugin] TypeScript error in Vitest config #34

@aleclarson

Description

@aleclarson

The codspeed() call is giving a TypeScript error with Vitest 1.6.0

Error

No overload matches this call.
  The last overload gave the following error.
    Type '{ name: string; apply(_: any, { mode }: { mode: any; }): boolean; enforce: string; config(): { test: { pool: string; poolOptions: { forks: { execArgv: string[]; }; }; runner: string; globalSetup: string[]; }; }; }' is not assignable to type 'PluginOption'.
      Type '{ name: string; apply(_: any, { mode }: { mode: any; }): boolean; enforce: string; config(): { test: { pool: string; poolOptions: { forks: { execArgv: string[]; }; }; runner: string; globalSetup: string[]; }; }; }' is not assignable to type 'Plugin<any>'.
        Types of property 'enforce' are incompatible.
          Type 'string' is not assignable to type '"post" | "pre" | undefined'.ts(2769)

Config

import codspeed from '@codspeed/vitest-plugin'
import { defineConfig } from 'vitest/config'

export default defineConfig({
  plugins: [codspeed()],
})
  • vitest v1.6.0
  • @codspeed/vitest-plugin v3.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions