KC's Workspace
    Preparing search index...
    Index

    Constructors

    Properties

    distPath: string

    A path to the built Vitest directory. This is usually a folder in node_modules.

    logger: Logger

    The logger instance used to log messages. It's recommended to use this logger instead of console. It's possible to override stdout and stderr streams when initiating Vitest.

    new Vitest('test', {
    stdout: new Writable(),
    })
    packageInstaller: VitestPackageInstaller

    The package installer instance used to install Vitest packages.

    await vitest.packageInstaller.ensureInstalled('@vitest/browser', process.cwd())
    
    projects: TestProject[]

    A list of projects that are currently running. If projects were filtered with --project flag, they won't appear here.

    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.

    version: string

    Current Vitest version.

    '2.0.0'
    
    watcher: VitestWatcher

    A watcher handler. This is not the file system watcher. The handler only exposes methods to handle changed files.

    If you have your own watcher, you can use these methods to replicate Vitest behaviour.

    version: string

    Accessors

    Methods