mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
By default, all of the tests run in silent mode with monkey-patched the console logging so no console logging will ever appear in test output. This confuses the agent- sometimes it will add console logging to help it debug things, and it won't see the logs that it expects. Adds src/utils/vitest-verbosity.ts to handle verbosity resolution and console logging. Modifies src/vitest.config.ts and webview-ui/vitest.config.ts to integrate the new verbosity control. Removes manual console suppression from src/vitest.setup.ts and webview-ui/vitest.setup.ts as it's now handled dynamically. Co-authored-by: Chris Hasson <noreply@example.com>
17 lines
458 B
TypeScript
17 lines
458 B
TypeScript
import nock from "nock"
|
|
|
|
import "./utils/path" // Import to enable String.prototype.toPosix().
|
|
|
|
// Disable network requests by default for all tests.
|
|
nock.disableNetConnect()
|
|
|
|
export function allowNetConnect(host?: string | RegExp) {
|
|
if (host) {
|
|
nock.enableNetConnect(host)
|
|
} else {
|
|
nock.enableNetConnect()
|
|
}
|
|
}
|
|
|
|
// Global mocks that many tests expect.
|
|
global.structuredClone = global.structuredClone || ((obj: any) => JSON.parse(JSON.stringify(obj)))
|