namespace

test.default.EventData

namespace EventData

  • interface Error

  • interface LocationInfo

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

  • interface TestComplete

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • details: { duration_ms: number; error: Error; passed: boolean; type: 'suite' | 'test' }

      Additional execution metadata.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • skip?: string | boolean

      Present if context.skip is called.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

    • testNumber: number

      The ordinal number of the test.

    • todo?: string | boolean

      Present if context.todo is called.

  • interface TestCoverage

    • nesting: number

      The nesting level of the test.

    • summary: { files: { branches: { count: number; line: number }[]; coveredBranchCount: number; coveredBranchPercent: number; coveredFunctionCount: number; coveredFunctionPercent: number; coveredLineCount: number; coveredLinePercent: number; functions: { count: number; line: number; name: string }[]; lines: { count: number; line: number }[]; path: string; totalBranchCount: number; totalFunctionCount: number; totalLineCount: number }[]; thresholds: { branch: number; function: number; line: number }; totals: { coveredBranchCount: number; coveredBranchPercent: number; coveredFunctionCount: number; coveredFunctionPercent: number; coveredLineCount: number; coveredLinePercent: number; totalBranchCount: number; totalFunctionCount: number; totalLineCount: number }; workingDirectory: string }

      An object containing the coverage report.

  • interface TestDequeue

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

    • type: 'suite' | 'test'

      The test type. Either 'suite' or 'test'.

  • interface TestDiagnostic

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • level: 'error' | 'info' | 'warn'

      The severity level of the diagnostic message. Possible values are:

      • 'info': Informational messages.
      • 'warn': Warnings.
      • 'error': Errors.
    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • message: string

      The diagnostic message.

    • nesting: number

      The nesting level of the test.

  • interface TestEnqueue

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

    • type: 'suite' | 'test'

      The test type. Either 'suite' or 'test'.

  • interface TestFail

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • details: { attempt: number; duration_ms: number; error: Error; type: 'suite' | 'test' }

      Additional execution metadata.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • skip?: string | boolean

      Present if context.skip is called.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

    • testNumber: number

      The ordinal number of the test.

    • todo?: string | boolean

      Present if context.todo is called.

  • interface TestInterrupted

    • tests: TestStart[]

      An array of objects containing information about the interrupted tests.

  • interface TestLog

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • data: unknown

      The structured payload passed to context.log, or undefined if none was provided. The test runner does not interpret this value.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • message: string

      The log message.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests.

    • testId: number

      A numeric identifier for the test instance that emitted the log message.

  • interface TestPass

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • details: { attempt: number; duration_ms: number; passed_on_attempt: number; type: 'suite' | 'test' }

      Additional execution metadata.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • skip?: string | boolean

      Present if context.skip is called.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

    • testNumber: number

      The ordinal number of the test.

    • todo?: string | boolean

      Present if context.todo is called.

  • interface TestPlan

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • count: number

      The number of subtests that have ran.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • nesting: number

      The nesting level of the test.

  • interface TestStart

    • column?: number

      The column number where the test is defined, or undefined if the test was run through the REPL.

    • entryFile?: string

      The path of the test file that was executed as the entry point of the child process that emitted this event. Only present when tests run with process isolation. May differ from file when the test is defined in a module imported by the entry file.

    • file?: string

      The path of the test file, undefined if test was run through the REPL.

    • line?: number

      The line number where the test is defined, or undefined if the test was run through the REPL.

    • name: string

      The test name.

    • nesting: number

      The nesting level of the test.

    • parentId: undefined | number

      The testId of the enclosing test, or undefined for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.

    • tags: string[]

      The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.

    • testId: number

      A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.

  • interface TestStderr

    • file: string

      The path of the test file.

    • message: string

      The message written to stderr.

  • interface TestStdout

    • file: string

      The path of the test file.

    • message: string

      The message written to stdout.

  • interface TestSummary

    • counts: { cancelled: number; passed: number; skipped: number; suites: number; tests: number; todo: number; topLevel: number }

      An object containing the counts of various test results.

    • duration_ms: number

      The duration of the test run in milliseconds.

    • file: undefined | string

      The path of the test file that generated the summary. If the summary corresponds to multiple files, this value is undefined.

    • success: boolean

      Indicates whether or not the test run is considered successful or not. If any error condition occurs, such as a failing test or unmet coverage threshold, this value will be set to false.