@rstest/core 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -502,6 +502,7 @@ declare class DefaultReporter implements Reporter {
502
502
  onTestFileStart(test: TestFileInfo): void;
503
503
  onTestFileResult(test: TestFileResult): void;
504
504
  onTestCaseResult(result: TestResult): void;
505
+ onTestCaseStart(test: TestCaseInfo): void;
505
506
  onUserConsoleLog(log: UserConsoleLog): void;
506
507
  onExit(): Promise<void>;
507
508
  onTestRunEnd({ results, testResults, duration, getSourcemap, snapshotSummary, filterRerunTestPaths, }: {
@@ -537,6 +538,7 @@ declare type DescribeAPI = DescribeFn & {
537
538
  declare interface DescribeEachFn {
538
539
  <T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
539
540
  <T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>) => void;
541
+ <T>(cases: readonly T[]): (description: string, fn: (param: T) => MaybePromise<void>) => void;
540
542
  }
541
543
 
542
544
  declare type DescribeFn = (description: string, fn?: () => void) => void;
@@ -1725,6 +1727,10 @@ declare interface Reporter {
1725
1727
  * Called when the test has finished running or was just skipped.
1726
1728
  */
1727
1729
  onTestCaseResult?: (result: TestResult) => void;
1730
+ /**
1731
+ * Called before running the test case.
1732
+ */
1733
+ onTestCaseStart?: (test: TestCaseInfo) => void;
1728
1734
  /**
1729
1735
  * Called after all tests have finished running.
1730
1736
  */
@@ -2055,6 +2061,7 @@ declare type RuntimeRPC = {
2055
2061
  assetFiles: Record<string, string>;
2056
2062
  sourceMaps: Record<string, string>;
2057
2063
  }>;
2064
+ onTestCaseStart: (test: TestCaseInfo) => Promise<void>;
2058
2065
  onTestCaseResult: (result: TestResult) => Promise<void>;
2059
2066
  getCountOfFailedTests: () => Promise<number>;
2060
2067
  onConsoleLog: (log: UserConsoleLog) => void;
@@ -2257,6 +2264,7 @@ declare class StatusRenderer {
2257
2264
  getContent(): string[];
2258
2265
  onTestFileStart(testPath: string): void;
2259
2266
  onTestCaseResult(result: TestResult): void;
2267
+ onTestCaseStart(test: TestCaseInfo): void;
2260
2268
  onTestFileResult(test: TestFileResult): void;
2261
2269
  clear(): void;
2262
2270
  }
@@ -2324,13 +2332,10 @@ declare type TestAPIs<ExtraContext = object> = TestAPI<ExtraContext> & {
2324
2332
 
2325
2333
  declare type TestCallbackFn<ExtraContext = object> = (context: TestContext & ExtraContext) => MaybePromise<void>;
2326
2334
 
2327
- declare type TestCase = {
2328
- testPath: TestPath;
2329
- name: string;
2335
+ declare type TestCase = TestCaseInfo & {
2330
2336
  originalFn?: (context: TestContext) => void | Promise<void>;
2331
2337
  fn?: (context: TestContext) => void | Promise<void>;
2332
2338
  runMode: TestRunMode;
2333
- timeout?: number;
2334
2339
  fails?: boolean;
2335
2340
  each?: boolean;
2336
2341
  fixtures?: NormalizedFixtures;
@@ -2342,7 +2347,6 @@ declare type TestCase = {
2342
2347
  onFinished: OnTestFinishedHandler[];
2343
2348
  onFailed: OnTestFailedHandler[];
2344
2349
  type: 'case';
2345
- parentNames?: string[];
2346
2350
  /**
2347
2351
  * Store promises (from async expects) to wait for them before finishing the test
2348
2352
  */
@@ -2351,7 +2355,16 @@ declare type TestCase = {
2351
2355
  * Result of the task. if `expect.soft()` failed multiple times or `retry` was triggered.
2352
2356
  */
2353
2357
  result?: TaskResult;
2358
+ };
2359
+
2360
+ declare type TestCaseInfo = {
2361
+ testId: string;
2362
+ testPath: TestPath;
2363
+ name: string;
2364
+ timeout?: number;
2365
+ parentNames?: string[];
2354
2366
  project: string;
2367
+ startTime?: number;
2355
2368
  };
2356
2369
 
2357
2370
  declare type TestContext = {
@@ -2397,6 +2410,7 @@ declare type TestPath = string;
2397
2410
  declare type TestProject = string | ProjectConfig;
2398
2411
 
2399
2412
  declare type TestResult = {
2413
+ testId: string;
2400
2414
  status: TestResultStatus;
2401
2415
  name: string;
2402
2416
  testPath: TestPath;
@@ -2423,6 +2437,7 @@ declare class TestStateManager {
2423
2437
  }
2424
2438
 
2425
2439
  declare type TestSuite = {
2440
+ testId: string;
2426
2441
  name: string;
2427
2442
  parentNames?: string[];
2428
2443
  runMode: TestRunMode;