Skip to content

Commit d3b3215

Browse files
committed
test: try again
1 parent b5ac468 commit d3b3215

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test-utils/index.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@ import { Readable, Writable } from 'node:stream'
88
import { fileURLToPath } from 'node:url'
99
import { dirname, resolve } from 'pathe'
1010
import { x } from 'tinyexec'
11-
import { afterEach, onTestFinished, vi, type WorkerGlobalState } from 'vitest'
11+
import * as tinyrainbow from 'tinyrainbow'
12+
import { afterEach, onTestFinished, type WorkerGlobalState } from 'vitest'
1213
import { startVitest } from 'vitest/node'
1314
import { getCurrentTest } from 'vitest/suite'
1415
import { Cli } from './cli'
1516

16-
vi.mock('tinyrainbow', async (importOriginal) => {
17-
const { getDefaultColors, createColors, isSupported } = await importOriginal<any>()
18-
return {
19-
default: getDefaultColors(),
20-
getDefaultColors,
21-
createColors,
22-
isSupported,
23-
}
24-
})
17+
// override default colors to disable them in tests
18+
Object.assign(tinyrainbow.default, tinyrainbow.getDefaultColors())
2519

2620
interface VitestRunnerCLIOptions {
2721
std?: 'inherit'

test/test-utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"devDependencies": {
1010
"tinyexec": "^0.3.0",
11+
"tinyrainbow": "^1.2.0",
1112
"vite": "latest",
1213
"vite-node": "workspace:*",
1314
"vitest": "workspace:*"

0 commit comments

Comments
 (0)