@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.
@@ -1,8 +1,8 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
3
  import { __webpack_require__ } from "./rslib-runtime.js";
4
- import { external_node_module_createRequire } from "./857.js";
5
- import { pathToFileURL } from "./808.js";
4
+ import { external_node_module_createRequire } from "./946.js";
5
+ import { pathToFileURL } from "./770.js";
6
6
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
7
7
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
8
8
  const CoverageProviderMap = {
@@ -337,7 +337,7 @@ declare type CommonOptions = {
337
337
  maxConcurrency?: number;
338
338
  slowTestThreshold?: number;
339
339
  hideSkippedTests?: boolean;
340
- bail?: number;
340
+ bail?: number | boolean;
341
341
  };
342
342
 
343
343
  declare type CompareKeys = ((a: string, b: string) => number) | null | undefined;
@@ -596,6 +596,7 @@ declare class DefaultReporter implements Reporter {
596
596
  onTestFileStart(test: TestFileInfo): void;
597
597
  onTestFileResult(test: TestFileResult): void;
598
598
  onTestCaseResult(result: TestResult): void;
599
+ onTestCaseStart(test: TestCaseInfo): void;
599
600
  onUserConsoleLog(log: UserConsoleLog): void;
600
601
  onExit(): Promise<void>;
601
602
  onTestRunEnd({ results, testResults, duration, getSourcemap, snapshotSummary, filterRerunTestPaths, }: {
@@ -655,6 +656,7 @@ export declare const describe: Rstest['describe'];
655
656
  declare interface DescribeEachFn {
656
657
  <T extends Record<string, unknown>>(cases: readonly T[]): (description: string, fn?: (param: T) => MaybePromise<void>) => void;
657
658
  <T extends readonly [unknown, ...unknown[]]>(cases: readonly T[]): (description: string, fn: (...args: [...T]) => MaybePromise<void>) => void;
659
+ <T>(cases: readonly T[]): (description: string, fn: (param: T) => MaybePromise<void>) => void;
658
660
  }
659
661
 
660
662
  declare type DescribeFn = (description: string, fn?: () => void) => void;
@@ -2075,6 +2077,10 @@ export declare interface Reporter {
2075
2077
  * Called when the test has finished running or was just skipped.
2076
2078
  */
2077
2079
  onTestCaseResult?: (result: TestResult) => void;
2080
+ /**
2081
+ * Called before running the test case.
2082
+ */
2083
+ onTestCaseStart?: (test: TestCaseInfo) => void;
2078
2084
  /**
2079
2085
  * Called after all tests have finished running.
2080
2086
  */
@@ -2490,6 +2496,10 @@ export declare interface RstestUtilities {
2490
2496
  * Update runtime config for the current test.
2491
2497
  */
2492
2498
  setConfig: (config: RuntimeOptions) => void;
2499
+ /**
2500
+ * get runtime config for the current test.
2501
+ */
2502
+ getConfig: () => RuntimeOptions;
2493
2503
  /**
2494
2504
  * Reset runtime config that were changed with `rstest.setConfig`.
2495
2505
  */
@@ -2723,6 +2733,7 @@ declare class StatusRenderer {
2723
2733
  getContent(): string[];
2724
2734
  onTestFileStart(testPath: string): void;
2725
2735
  onTestCaseResult(result: TestResult): void;
2736
+ onTestCaseStart(test: TestCaseInfo): void;
2726
2737
  onTestFileResult(test: TestFileResult): void;
2727
2738
  clear(): void;
2728
2739
  }
@@ -2773,6 +2784,16 @@ declare type TestAPIs<ExtraContext = object> = TestAPI<ExtraContext> & {
2773
2784
 
2774
2785
  declare type TestCallbackFn<ExtraContext = object> = (context: TestContext & ExtraContext) => MaybePromise<void>;
2775
2786
 
2787
+ export declare type TestCaseInfo = {
2788
+ testId: string;
2789
+ testPath: TestPath;
2790
+ name: string;
2791
+ timeout?: number;
2792
+ parentNames?: string[];
2793
+ project: string;
2794
+ startTime?: number;
2795
+ };
2796
+
2776
2797
  declare type TestContext = {
2777
2798
  expect: Expect;
2778
2799
  onTestFinished: RunnerAPI['onTestFinished'];
@@ -2816,6 +2837,7 @@ declare type TestPath = string;
2816
2837
  declare type TestProject = string | ProjectConfig;
2817
2838
 
2818
2839
  export declare type TestResult = {
2840
+ testId: string;
2819
2841
  status: TestResultStatus;
2820
2842
  name: string;
2821
2843
  testPath: TestPath;