An instance of SuiteContext is passed to each suite function in order to interact with the test runner. However, the SuiteContext constructor is not exposed as part of the API.
interface
test.default.SuiteContext
interface SuiteContext
- readonly attempt: number
The attempt number of the suite. This value is zero-based, so the first attempt is
0, the second attempt is1, and so on. This property is useful in conjunction with the--test-rerun-failuresoption to determine the attempt number of the current run. - readonly filePath: undefined | string
The absolute path of the test file that created the current suite. If a test file imports additional modules that generate suites, the imported suites will return the path of the root test file.
- message: string): void;
Output a diagnostic message. This is typically used for logging information about the current suite or its tests.
test.describe('my suite', (suite) => { suite.diagnostic('Suite diagnostic message'); });@param messageA diagnostic message to output.