Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/vitest/src/node/config/serializeConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { TestProject } from '../project'
import type { ApiConfig, SerializedConfig } from '../types/config'
import { configDefaults } from '../../defaults'
import { isAgent } from '../../utils/env'

export function serializeConfig(project: TestProject): SerializedConfig {
const { config, globalConfig } = project
Expand Down Expand Up @@ -146,5 +147,6 @@ export function serializeConfig(project: TestProject): SerializedConfig {
config.slowTestThreshold
?? globalConfig.slowTestThreshold
?? configDefaults.slowTestThreshold,
isAgent,
}
}
6 changes: 6 additions & 0 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
import { populateProjectsTags } from './tags'
import { TestRun } from './test-run'
import { VitestWatcher } from './watcher'
import { disableDefaultColors } from 'tinyrainbow'

Check failure on line 55 in packages/vitest/src/node/core.ts

View workflow job for this annotation

GitHub Actions / Lint: node-latest, ubuntu-latest

Expected "tinyrainbow" (value-external) to come before "./watcher" (value-sibling)
import { isAgent } from '../utils/env'

const WATCHER_DEBOUNCE = 100

Expand Down Expand Up @@ -137,6 +139,10 @@
cliOptions: UserConfig,
options: VitestOptions = {},
) {
if (isAgent) {
disableDefaultColors()
}

this._cliOptions = cliOptions
this.logger = new Logger(this, options.stdout, options.stderr)
this.packageInstaller = options.packageInstaller || new VitestPackageInstaller()
Expand Down
1 change: 1 addition & 0 deletions packages/vitest/src/runtime/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export interface SerializedConfig {
tagsFilter: string[] | undefined
strictTags: boolean
slowTestThreshold: number | undefined
isAgent: boolean
}

export interface SerializedCoverageConfig {
Expand Down
5 changes: 5 additions & 0 deletions packages/vitest/src/runtime/workers/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import * as listeners from '../listeners'
import { createRuntimeRpc } from '../rpc'
import * as entrypoint from '../worker'
import { disableDefaultColors } from 'tinyrainbow'

Check failure on line 10 in packages/vitest/src/runtime/workers/init.ts

View workflow job for this annotation

GitHub Actions / Lint: node-latest, ubuntu-latest

Expected "tinyrainbow" (value-external) to come before "../worker" (value-parent)

interface Options extends VitestWorker {
teardown?: () => void
Expand Down Expand Up @@ -49,6 +50,10 @@
process.env.VITEST_WORKER_ID = String(message.workerId)
reportMemory = message.options.reportMemory

if (message.context.config.isAgent) {
disableDefaultColors()
}

traces ??= await new Traces({
enabled: message.traces.enabled,
sdkPath: message.traces.sdkPath,
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ catalog:
tinyexec: ^1.0.2
tinyglobby: ^0.2.15
tinyhighlight: ^0.3.2
tinyrainbow: ^3.0.3
tinyrainbow: ^3.1.0
tinyspy: ^4.0.4
typescript: ^5.9.3
unocss: ^66.6.6
Expand Down
Loading