MCPcopy
hub / github.com/jestjs/jest / readGlobalsCleanupConfig

Function readGlobalsCleanupConfig

packages/jest-environment-node/src/index.ts:371–392  ·  view source on GitHub ↗
(
  projectConfig: Config.ProjectConfig,
)

Source from the content-addressed store, hash-verified

369}
370
371function readGlobalsCleanupConfig(
372 projectConfig: Config.ProjectConfig,
373): DeletionMode {
374 const rawConfig = projectConfig.testEnvironmentOptions.globalsCleanup;
375 const config = rawConfig?.toString()?.toLowerCase();
376 switch (config) {
377 case 'off':
378 case 'on':
379 case 'soft':
380 return config;
381 default: {
382 if (config !== undefined) {
383 logValidationWarning(
384 'testEnvironmentOptions.globalsCleanup',
385 `Unknown value given: ${rawConfig}`,
386 'Available options are: [on, soft, off]',
387 );
388 }
389 return 'soft';
390 }
391 }
392}

Callers 1

constructorMethod · 0.85

Calls 2

logValidationWarningFunction · 0.90
toStringMethod · 0.45

Tested by

no test coverage detected