Interface: TestRecord
A test, with the effective values the runner applies, including those inherited from its describes.
Properties
id
id:
string
Derived from the file path, the describe titles, the title and its position among tests with the same title.
bodyHash
bodyHash:
string|null
Hash of the test body, ignoring whitespace and comments: the test function, one passed by name, or the one a wrapper call receives; null when the test has none of these.
dependencyHash
dependencyHash:
string
Hash of everything the test runs in the project: its call, the hooks, options and code of the file and of every describe around it, and the functions, classes, constants and modules these use, followed through imports. Ignores whitespace and comments. Installed packages are not in it.
dependencies
dependencies:
string[]
The files that went into dependencyHash, the test's own included, sorted, with / separators.
hasUnfollowedDependencies
hasUnfollowedDependencies:
boolean
Something the test reaches couldn't be followed, so a change there doesn't change dependencyHash.
dependencyGlobs
dependencyGlobs:
string[][]
Root-relative Vite module patterns, grouped by call. Within each group a leading ! excludes matching paths.
unfollowedDependencies
unfollowedDependencies:
string[]
Where the test reaches what couldn't be followed: the file and line of each place, as support/venues.ts:2, sorted; empty when hasUnfollowedDependencies is false. A dependency-not-followed warning at the place says what it is.
suiteId
suiteId:
string|null
The nearest describe; null outside any describe.
parentTestId
parentTestId:
string|null
The test whose body declares this one as a subtest, which node:test runs while it runs that test; null for every other test.
suitePath
suitePath:
string[]
Titles of the describes around the test, and of the tests a subtest is declared in, outermost first.
relativeFilePath
relativeFilePath:
string
Path from the project root, with / separators.
fileName
fileName:
string
lineStart
lineStart:
number
lineEnd
lineEnd:
number
columnStart
columnStart:
number
In UTF-16 code units.
columnEnd
columnEnd:
number
In UTF-16 code units.
declaredAt
declaredAt: {
relativeFilePath:string;lineStart:number;columnStart:number; } |null
Where a helper imported from another file writes the test; the record's location is then the call that registers it. Null for code written in the scanned file.
Union Members
Type Literal
{ relativeFilePath: string; lineStart: number; columnStart: number; }
relativeFilePath
relativeFilePath:
string
The helper's file, from the project root.
lineStart
lineStart:
number
columnStart
columnStart:
number
In UTF-16 code units.
null
title
title:
string
As the runner shows it, tags included.
titleWithoutTags
titleWithoutTags:
string
title with @tag words removed and spaces tidied.
hasDynamicTitle
hasDynamicTitle:
boolean
The title could not be resolved to a fixed string, so title holds its source text.
fullName
fullName:
string
suitePath and title joined with " > ".
isTypeTest
isTypeTest:
boolean
Declared in a Vitest type test file (*.test-d.ts, *.spec-d.ts).
state
state:
"active"|"skip"|"fixme"|"todo"|"expectedToFail"|"notLoaded"
isActive
isActive:
boolean
True only for state active; false does not establish that the test never executes.
isSkipped
isSkipped:
boolean
isFixme
isFixme:
boolean
isTodo
isTodo:
boolean
isExpectedToFail
isExpectedToFail:
boolean
isNotLoaded
isNotLoaded:
boolean
The runner did not load this test, possibly because its describe failed; a diagnostic at stateLine says why.
isOnly
isOnly:
boolean
The test is selected by a .only, following the runner's focus rules.
isConditional
isConditional:
boolean
The state applies only when a condition holds, as with test.skip(condition) or skipIf.
condition
condition:
string|null
Source text of the condition, shortened when long; null when unconditional.
reason
reason:
string|null
hasDynamicReason
hasDynamicReason:
boolean
The reason could not be worked out to a string, so reason holds its source text.
stateSource
stateSource:
"config"|"file"|"suite"|"test"|null
null for active tests.
stateLine
stateLine:
number|null
The line that sets the state; null for active tests.
isParallel
isParallel:
boolean
Both isParallel and isSerial false means the framework's default mode.
isSerial
isSerial:
boolean
tags
tags:
string[]
From the test and every describe around it, outermost first, without duplicates.
annotations
annotations:
object[]
type
type:
string
description
description:
string|null
lineStart
lineStart:
number
comments
comments:
string[]
Comment lines directly above the test. By default only filled for tests that are not active.
locks
locks:
string[]
From the test, its describes and the test.describe.configure() calls around it. Playwright only.
meta
meta:
Record<string,MetaValue> |null
Merged from the describes and the test. Vitest only; literal values only.
hooks
hooks:
object
Every hook that runs around the test: those of the file and of each describe around it.
beforeAll
beforeAll:
number
beforeEach
beforeEach:
number
afterEach
afterEach:
number
afterAll
afterAll:
number
aroundEach
aroundEach:
number
Vitest only.
aroundAll
aroundAll:
number
Vitest only.
timeout
timeout:
number|null
In milliseconds: the last test.setTimeout() in the body or a beforeEach, otherwise the nearest describe or file that sets one, otherwise the config. Null when none sets it, so the runner's default applies.
isSlow
isSlow:
boolean
Playwright test.slow() applies: the runner triples the timeout.
slowCondition
slowCondition:
string|null
Source text of the condition of the test.slow() that applies; null when unconditional or not slow.
retries
retries:
number|null
Effective retry count from the test, suite, file or config; null when absent or unknown. See retriesSource.
retryDelay
retryDelay:
number|null
Milliseconds between retries: Vitest's from the retry object (4.1), Jest's from waitBeforeRetry of jest.retryTimes() (30.0); null otherwise.
retryCondition
retryCondition:
string|null
Vitest only: source text of the retry object's condition, a RegExp or a function.
repeats
repeats:
number|null
How many times the runner runs the test again after the first run: Vitest's or Bun's repeats, or Playwright's repeatEach from the config less one.
timeoutSource
timeoutSource:
"config"|"file"|"suite"|"test"|null
Where timeout comes from; null when nothing sets it. A null timeout from the config means the config sets it, but its projects set different values or the value depends on a condition, as in process.env.CI ? 2 : 0.
retriesSource
retriesSource:
"config"|"file"|"suite"|"test"|null
Where retries, retryDelay and retryCondition come from, read as timeoutSource is.
repeatsSource
repeatsSource:
"config"|"file"|"suite"|"test"|null
Where repeats comes from, read as timeoutSource is.
timeoutConfigText
timeoutConfigText:
string|null
The config's source text for timeout when the config sets it under a condition, as in process.env.CI ? 60_000 : 30_000, shortened when long; null otherwise.
retriesConfigText
retriesConfigText:
string|null
The config's source text for retries, read as timeoutConfigText is.
repeatsConfigText
repeatsConfigText:
string|null
The config's source text for repeats, Playwright's repeatEach, read as timeoutConfigText is.
fixtures
fixtures:
string[]
Names the test function takes from its context, then those of the beforeEach, afterEach and aroundEach hooks around it, once each. Vitest's own context keys, such as expect and task, are left out.
expectCount
expectCount:
number
Calls of expect(), expect.soft() and expect.poll() written in the body, each counted once.
expectedAssertions
expectedAssertions:
number|null
Vitest expect.assertions(n) in the body.
expectsAssertions
expectsAssertions:
boolean
Vitest expect.hasAssertions() in the body.
hasEmptyBody
hasEmptyBody:
boolean
The test function has no statements, comments aside.
steps
steps:
object[]
Playwright test.step() and test.step.skip() calls in the body, in source order.
title
title:
string
The title, or its source text when it can't be worked out.
hasDynamicTitle
hasDynamicTitle:
boolean
lineStart
lineStart:
number
depth
depth:
number
0 for a step directly in the test, 1 for a step inside it, and so on.
isSkipped
isSkipped:
boolean
Declared with test.step.skip().
isBenchmark
isBenchmark:
boolean
Vitest 5 benchmark: in a benchmark file, or using the bench fixture. Plain vitest doesn't run it.
isParameterized
isParameterized:
boolean
Declared with .each or .for, or inside a describe declared with them, so the runner repeats it.
caseCount
caseCount:
number|null
How many times the runner repeats the test: the cases of its own table times those of each describe table and the passes of each loop around it. Null when the scan can't work out a table or a loop's values, or the test is neither parameterized nor in a loop.
caseIndex
caseIndex:
number|null
With expandCases, which case of its own table, or pass of the innermost loop around it inside its describe, the test is, from 0, as Vitest's %# counts; null without expandCases, or when the test isn't one of several. The case of a describe table or loop around the describe is the describe's caseIndex.
isInLoop
isInLoop:
boolean
Declared inside a loop, forEach or map.
isInCondition
isInCondition:
boolean
Declared inside if, ?:, &&, switch or a catch block.
isInFunction
isInFunction:
boolean
Declared inside a plain function.
projects
projects:
string[] |null
Names of the projects that run the test, of the config its file uses, after each project's files and Playwright's grep and grepInvert. [] when no project runs it; null when there is no config, or the scan can't tell.