KC's Workspace
    Preparing search index...
    Index

    Constructors

    Properties

    browser?: ProjectBrowser

    Browser instance if the browser is enabled. This is initialized when the tests run for the first time.

    globalConfig: ResolvedConfig

    Resolved global configuration. If there are no workspace projects, this will be the same as config.

    provide: <T extends never>(key: T, value: ProvidedContext[T]) => void

    Provide a value to the test context. This value will be available to all tests with inject.

    tmpDir: string

    Temporary directory for the project. This is unique for each project. Vitest stores transformed content here.

    vitest: Vitest

    The global Vitest instance.

    Accessors

    Methods

    • Get all files in the project that match the globs in the config and the filters.

      Parameters

      • Optionalfilters: string[]

        String filters to match the test files.

      Returns Promise<{ testFiles: string[]; typecheckTestFiles: string[] }>

    • Test if a file matches the test globs. This does the actual glob matching if the test is not cached, unlike isCachedTestFile.

      Parameters

      • moduleId: string
      • Optionalsource: () => string

      Returns boolean