Skip to content

Add configurable log level for vitest-pool-workers #12014

@ProductOfAmerica

Description

@ProductOfAmerica

Describe the solution

Currently, the @cloudflare/vitest-pool-workers package has the log level hardcoded to VERBOSE link:

const log = new Log(LogLevel.VERBOSE, { prefix: "vpw" });

This results in [vpw:debug] and [vpw:info] messages being printed on every test run, which adds noise to test output:

[vpw:debug] Adding `enable_nodejs_tty_module` compatibility flag...
[vpw:debug] Adding `enable_nodejs_fs_module` compatibility flag...
[vpw:info] Starting isolated runtimes for vitest.config.ts...

Requested feature:

Add a configuration option to control the log level, e.g.:

export default defineWorkersConfig({
 test: {
  poolOptions: {
    workers: {  
     logLevel: 'warn', // or 'none', 'error', 'info', 'debug', 'verbose'
      }, 
    },
   },  
});

Cleaner test output in CI/CD pipelines and local development, especially when running large test suites.

Metadata

Metadata

Labels

vitestRelating to the Workers Vitest integration

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions