@@ -401,15 +401,15 @@ export interface TeardownFn {
401
401
( fn : ( ) => void ) : void ;
402
402
}
403
403
404
- export type ImplementationFn < Args extends any [ ] , Context = unknown > =
404
+ export type ImplementationFn < Args extends unknown [ ] , Context = unknown > =
405
405
( ( t : ExecutionContext < Context > , ...args : Args ) => PromiseLike < void > ) |
406
406
( ( t : ExecutionContext < Context > , ...args : Args ) => Subscribable ) |
407
407
( ( t : ExecutionContext < Context > , ...args : Args ) => void ) ;
408
408
409
- export type TitleFn < Args extends any [ ] > = ( providedTitle : string | undefined , ...args : Args ) => string ;
409
+ export type TitleFn < Args extends unknown [ ] > = ( providedTitle : string | undefined , ...args : Args ) => string ;
410
410
411
411
/** A reusable test or hook implementation. */
412
- export type Macro < Args extends any [ ] , Context = unknown > = {
412
+ export type Macro < Args extends unknown [ ] , Context = unknown > = {
413
413
/** The function that is executed when the macro is used. */
414
414
readonly exec : ImplementationFn < Args , Context > ;
415
415
@@ -418,20 +418,20 @@ export type Macro<Args extends any[], Context = unknown> = {
418
418
} ;
419
419
420
420
/** A test or hook implementation. */
421
- export type Implementation < Args extends any [ ] , Context = unknown > = ImplementationFn < Args , Context > | Macro < Args , Context > ;
421
+ export type Implementation < Args extends unknown [ ] , Context = unknown > = ImplementationFn < Args , Context > | Macro < Args , Context > ;
422
422
423
423
export interface TryFn < Context = unknown > {
424
424
/**
425
425
* Attempt to run some assertions. The result must be explicitly committed or discarded or else
426
426
* the test will fail. The title may help distinguish attempts from one another.
427
427
*/
428
- < Args extends any [ ] > ( title : string , fn : Implementation < Args , Context > , ...args : Args ) : Promise < TryResult > ;
428
+ < Args extends unknown [ ] > ( title : string , fn : Implementation < Args , Context > , ...args : Args ) : Promise < TryResult > ;
429
429
430
430
/**
431
431
* Attempt to run some assertions. The result must be explicitly committed or discarded or else
432
432
* the test will fail.
433
433
*/
434
- < Args extends any [ ] > ( fn : Implementation < Args , Context > , ...args : Args ) : Promise < TryResult > ;
434
+ < Args extends unknown [ ] > ( fn : Implementation < Args , Context > , ...args : Args ) : Promise < TryResult > ;
435
435
}
436
436
437
437
export interface AssertionError extends Error { }
@@ -471,13 +471,13 @@ export interface TryResult {
471
471
472
472
export interface TestInterface < Context = unknown > {
473
473
/** Declare a concurrent test. Additional arguments are passed along. */
474
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
474
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
475
475
476
476
/**
477
477
* Declare a concurrent test that uses a macro. The macro is responsible for generating a unique test title.
478
478
* Additional arguments are passed along.
479
479
*/
480
- < Args extends any [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
480
+ < Args extends unknown [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
481
481
482
482
/** Declare a hook that is run once, after all tests have passed. */
483
483
after : AfterInterface < Context > ;
@@ -506,10 +506,10 @@ export interface TestInterface<Context = unknown> {
506
506
507
507
export interface AfterInterface < Context = unknown > {
508
508
/** Declare a hook that is run once, after all tests have passed. Additional arguments are passed along. */
509
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
509
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
510
510
511
511
/** Declare a hook that is run once, after all tests have passed. Additional arguments are passed along. */
512
- < Args extends any [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
512
+ < Args extends unknown [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
513
513
514
514
/** Declare a hook that is run once, after all tests are done. */
515
515
always : AlwaysInterface < Context > ;
@@ -519,65 +519,65 @@ export interface AfterInterface<Context = unknown> {
519
519
520
520
export interface AlwaysInterface < Context = unknown > {
521
521
/** Declare a hook that is run once, after all tests are done. Additional arguments are passed along. */
522
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
522
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
523
523
524
524
/** Declare a hook that is run once, after all tests are done. Additional arguments are passed along. */
525
- < Args extends any [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
525
+ < Args extends unknown [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
526
526
527
527
skip : HookSkipInterface < Context > ;
528
528
}
529
529
530
530
export interface BeforeInterface < Context = unknown > {
531
531
/** Declare a hook that is run once, before all tests. Additional arguments are passed along. */
532
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
532
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
533
533
534
534
/** Declare a hook that is run once, before all tests. Additional arguments are passed along. */
535
- < Args extends any [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
535
+ < Args extends unknown [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
536
536
537
537
skip : HookSkipInterface < Context > ;
538
538
}
539
539
540
540
export interface FailingInterface < Context = unknown > {
541
541
/** Declare a concurrent test. Additional arguments are passed along. The test is expected to fail. */
542
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
542
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
543
543
544
544
/**
545
545
* Declare a concurrent test that uses a macro. Additional arguments are passed along.
546
546
* The macro is responsible for generating a unique test title. The test is expected to fail.
547
547
*/
548
- < Args extends any [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
548
+ < Args extends unknown [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
549
549
550
550
only : OnlyInterface < Context > ;
551
551
skip : SkipInterface < Context > ;
552
552
}
553
553
554
554
export interface HookSkipInterface < Context = unknown > {
555
555
/** Skip this hook. */
556
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
556
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
557
557
558
558
/** Skip this hook. */
559
- < Args extends any [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
559
+ < Args extends unknown [ ] > ( implementation : Implementation < Args , Context > , ...args : Args ) : void ;
560
560
}
561
561
562
562
export interface OnlyInterface < Context = unknown > {
563
563
/** Declare a test. Additional arguments are passed along. Only this test and others declared with `.only()` are run. */
564
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
564
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
565
565
566
566
/**
567
567
* Declare a test that uses a macro. The macro is responsible for generating a unique test title.
568
568
* Only this test and others declared with `.only()` are run.
569
569
*/
570
- < Args extends any [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
570
+ < Args extends unknown [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
571
571
}
572
572
573
573
export interface SerialInterface < Context = unknown > {
574
574
/** Declare a serial test. Additional arguments are passed along. */
575
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
575
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
576
576
577
577
/**
578
578
* Declare a serial test that uses a macro. The macro is responsible for generating a unique test title.
579
579
*/
580
- < Args extends any [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
580
+ < Args extends unknown [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
581
581
582
582
/** Declare a serial hook that is run once, after all tests have passed. */
583
583
after : AfterInterface < Context > ;
@@ -601,26 +601,26 @@ export interface SerialInterface<Context = unknown> {
601
601
602
602
export interface SkipInterface < Context = unknown > {
603
603
/** Skip this test. */
604
- < Args extends any [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
604
+ < Args extends unknown [ ] > ( title : string , implementation : Implementation < Args , Context > , ...args : Args ) : void ;
605
605
606
606
/** Skip this test. */
607
- < Args extends any [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
607
+ < Args extends unknown [ ] > ( macro : Macro < Args , Context > , ...args : Args ) : void ;
608
608
}
609
609
610
610
export interface TodoDeclaration {
611
611
/** Declare a test that should be implemented later. */
612
612
( title : string ) : void ;
613
613
}
614
614
615
- export type MacroDeclarationOptions < Args extends any [ ] , Context = unknown > = {
615
+ export type MacroDeclarationOptions < Args extends unknown [ ] , Context = unknown > = {
616
616
exec : ImplementationFn < Args , Context > ;
617
617
title : TitleFn < Args > ;
618
618
} ;
619
619
620
620
export interface MacroDeclaration < Context = unknown > {
621
621
/** Declare a reusable test implementation. */
622
- < Args extends any [ ] > ( exec : ImplementationFn < Args , Context > ) : Macro < Args , Context > ;
623
- < Args extends any [ ] > ( declaration : MacroDeclarationOptions < Args , Context > ) : Macro < Args , Context > ;
622
+ < Args extends unknown [ ] > ( exec : ImplementationFn < Args , Context > ) : Macro < Args , Context > ;
623
+ < Args extends unknown [ ] > ( declaration : MacroDeclarationOptions < Args , Context > ) : Macro < Args , Context > ;
624
624
}
625
625
626
626
export interface MetaInterface {
0 commit comments