Specifies an Object, or an Array of Object,
which defines aliases used to replace values in import or require statements.
Will be merged with the default aliases inside resolve.alias.
Automatically assign environment based on globs. The first match will be used.
This has effect only when running tests inside Node.js.
Format: [glob, environment-name]
Default
[]
Example
[ // all tests in tests/dom will run in jsdom ['tests/dom/**', 'jsdom'], // all tests in tests/ with .edge.test.ts will run in edge-runtime ['**/*.edge.test.ts', 'edge-runtime'], // ... ]
Show full diff when snapshot fails instead of a patch.
OptionalfakeTimers
fakeTimers?:FakeTimerInstallOpts
Options for @sinon/fake-timers
OptionalfileParallelism
fileParallelism?:boolean
Should all test files run in parallel. Doesn't affect tests running in the same file.
Setting this to false will override maxWorkers and minWorkers options to 1.
Default
true
OptionalforceRerunTriggers
forceRerunTriggers?:string[]
Glob patter of file paths that will trigger the whole suite rerun
Useful if you are testing calling CLI commands
Default
[]
OptionalglobalSetup
globalSetup?:string | string[]
Path to global setup files
Optionalglobals
globals?:boolean
Register apis globally
Default
false
OptionalhideSkippedTests
hideSkippedTests?:boolean
Hide logs for skipped tests
Default
false
OptionalhookTimeout
hookTimeout?:number
Default timeout of a hook in milliseconds
Default
10000
Optionalinclude
include?:string[]
Include globs for test files
Default
['**/*.{test,spec}.?(c|m)[jt]s?(x)']
OptionalincludeSource
includeSource?:string[]
Include globs for in-source test files
Default
[]
Optionalinspect
inspect?:boolean
Debug tests by opening node:inspector in worker / child process.
Provides similar experience as --inspect Node CLI argument.
Requires poolOptions.threads.singleThread: true OR poolOptions.forks.singleFork: true.
OptionalinspectBrk
inspectBrk?:boolean
Debug tests by opening node:inspector in worker / child process and wait for debugger to connect.
Provides similar experience as --inspect-brk Node CLI argument.
Requires poolOptions.threads.singleThread: true OR poolOptions.forks.singleFork: true.
Optionalisolate
isolate?:boolean
Run tests in an isolated environment. This option has no effect on vmThreads pool.
Disabling this option might improve performance if your code doesn't rely on side effects.
Default
true
OptionallogHeapUsage
logHeapUsage?:boolean
Show heap usage after each test. Useful for debugging memory leaks.
OptionalmaxConcurrency
maxConcurrency?:number
A number of tests that are allowed to run at the same time marked with test.concurrent.
Default
5
OptionalmaxWorkers
maxWorkers?:number
Maximum number of workers to run tests in. poolOptions.{threads,vmThreads}.maxThreads/poolOptions.forks.maxForks has higher priority.
OptionalminWorkers
minWorkers?:number
Minimum number of workers to run tests in. poolOptions.{threads,vmThreads}.minThreads/poolOptions.forks.minForks has higher priority.
OptionalmockReset
mockReset?:boolean
Will call .mockReset() on all spies before each test
Default
false
Optionalname
name?:string
Name of the project. Will be used to display in the reporter.
OptionalonConsoleLog
onConsoleLog?:((log, type) => false | void)
Custom handler for console.log in tests.
Return false to ignore the log.
Type declaration
(log, type): false | void
Custom handler for console.log in tests.
Return false to ignore the log.
Parameters
log: string
type: "stdout" | "stderr"
Returns false | void
OptionalonStackTrace
onStackTrace?:((error, frame) => boolean | void)
Enable stack trace filtering. If absent, all stack trace frames
will be shown.
Return false to omit the frame.
Type declaration
(error, frame): boolean | void
Enable stack trace filtering. If absent, all stack trace frames
will be shown.
Write test results to a file when the --reporter=jsonor--reporter=junit` option is also specified.
Also definable individually per reporter by using an object instead.
Automatically assign pool based on globs. The first match will be used.
Format: [glob, pool-name]
Default
[]
Example
[ // all tests in "forks" directory will run using "poolOptions.forks" API ['tests/forks/**', 'forks'], // all other tests will run based on "poolOptions.threads" option, if you didn't specify other globs // ... ]
Specifies an
Object, or anArrayofObject, which defines aliases used to replace values inimportorrequirestatements. Will be merged with the default aliases insideresolve.alias.