Content-Length: 264360 | pFad | https://github.com/vitest-dev/vitest/commit/bcc59088

19 feat(experimental): expose vite on the test project as a separate field · vitest-dev/vitest@bcc5908 · GitHub
Skip to content

Commit

Permalink
feat(experimental): expose vite on the test project as a separate field
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 29, 2024
1 parent 47d7c0a commit bcc5908
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/advanced/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ declare class TestProject {
* @experimental The public Vitest API is experimental and does not follow semver.
*/
readonly workspaceProject: WorkspaceProject
/**
* Vite's dev server instance. Every workspace project has its own server.
*/
readonly vite: ViteDevServer
/**
* Resolved project configuration.
*/
Expand Down
6 changes: 6 additions & 0 deletions packages/vitest/src/node/reported-workspace-project.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ViteDevServer } from 'vite'
import type { ProvidedContext } from '../types/general'
import type { Vitest } from './core'
import type { ResolvedConfig, ResolvedProjectConfig, SerializedConfig } from './types/config'
Expand All @@ -15,6 +16,10 @@ export class TestProject {
*/
public readonly workspaceProject: WorkspaceProject

/**
* Vite's dev server instance. Every workspace project has its own server.
*/
public readonly vite: ViteDevServer
/**
* Resolved project configuration.
*/
Expand All @@ -32,6 +37,7 @@ export class TestProject {
constructor(workspaceProject: WorkspaceProject) {
this.workspaceProject = workspaceProject
this.vitest = workspaceProject.ctx
this.vite = workspaceProject.server
this.globalConfig = workspaceProject.ctx.config
this.config = workspaceProject.config
this.name = workspaceProject.getName()
Expand Down

0 comments on commit bcc5908

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/vitest-dev/vitest/commit/bcc59088

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy