twd-js 1.2.2 → 1.3.0-beta.0

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.
package/dist/index.d.ts CHANGED
@@ -243,16 +243,20 @@ declare interface TWDAPI {
243
243
  /**
244
244
  * Wait for a mocked request to be made.
245
245
  * @param alias The alias of the mock rule to wait for
246
+ * @param retries The number of retries to make
247
+ * @param retryDelay The delay between retries
246
248
  * @return The matched rule (with body if applicable)
247
249
  *
248
250
  * @example
249
251
  * ```ts
250
252
  * const rule = await twd.waitFor("aliasId");
251
253
  * console.log(rule.body);
254
+ * const rule = await twd.waitFor("aliasId", 5, 100);
255
+ * console.log(rule.body);
252
256
  *
253
257
  * ```
254
258
  */
255
- waitForRequest: (alias: string) => Promise<Rule>;
259
+ waitForRequest: (alias: string, retries?: number, retryDelay?: number) => Promise<Rule>;
256
260
  /**
257
261
  * wait for a list of mocked requests to be made.
258
262
  * @param aliases The aliases of the mock rules to wait for
@@ -424,7 +428,7 @@ declare type URLAssertionName = "eq" | "contain.url";
424
428
 
425
429
  declare type URLCommandAPI = {
426
430
  location: Location;
427
- should: (name: AnyURLAssertion, value: string) => URLCommandAPI | string;
431
+ should: (name: AnyURLAssertion, value: string, retries?: number) => Promise<string>;
428
432
  };
429
433
 
430
434
  declare type UserEvent = typeof default_2;