aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/bun-types/bun-test.d.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/bun-types/bun-test.d.ts b/packages/bun-types/bun-test.d.ts
index f6e968906..790d8bfea 100644
--- a/packages/bun-types/bun-test.d.ts
+++ b/packages/bun-types/bun-test.d.ts
@@ -169,6 +169,25 @@ declare module "bun:test" {
* @param condition if these tests should be skipped
*/
skipIf(condition: boolean): (label: string, fn: () => void) => void;
+ /**
+ * Returns a function that runs for each item in `table`.
+ *
+ * @param table Array of Arrays with the arguments that are passed into the test fn for each row.
+ */
+ each<T extends ReadonlyArray<unknown>>(
+ table: ReadonlyArray<T>,
+ ): (
+ label: string,
+ fn: (...args: T) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
+ each<T>(
+ table: ReadonlyArray<T>,
+ ): (
+ label: string,
+ fn: (arg: T) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
};
/**
* Describes a group of related tests.
@@ -395,6 +414,25 @@ declare module "bun:test" {
| ((done: (err?: unknown) => void) => void),
options?: number | TestOptions,
) => void;
+ /**
+ * Returns a function that runs for each item in `table`.
+ *
+ * @param table Array of Arrays with the arguments that are passed into the test fn for each row.
+ */
+ each<T extends ReadonlyArray<unknown>>(
+ table: ReadonlyArray<T>,
+ ): (
+ label: string,
+ fn: (...args: T) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
+ each<T>(
+ table: ReadonlyArray<T>,
+ ): (
+ label: string,
+ fn: (arg: T, done: (err?: unknown) => void) => void | Promise<unknown>,
+ options?: number | TestOptions,
+ ) => void;
};
/**
* Runs a test.