@@ -409,24 +409,11 @@ export interface TryFn<Context = unknown> {
409
409
*/
410
410
< Args extends any [ ] > ( title : string , fn : EitherMacro < Args , Context > , ...args : Args ) : Promise < TryResult > ;
411
411
412
- /**
413
- * Attempt to run some assertions. The result must be explicitly committed or discarded or else
414
- * the test will fail. A macro may be provided. The title may help distinguish attempts from
415
- * one another.
416
- */
417
- < Args extends any [ ] > ( title : string , fn : [ EitherMacro < Args , Context > , ...Array < EitherMacro < Args , Context > > ] , ...args : Args ) : Promise < TryResult [ ] > ;
418
-
419
412
/**
420
413
* Attempt to run some assertions. The result must be explicitly committed or discarded or else
421
414
* the test will fail. A macro may be provided.
422
415
*/
423
416
< Args extends any [ ] > ( fn : EitherMacro < Args , Context > , ...args : Args ) : Promise < TryResult > ;
424
-
425
- /**
426
- * Attempt to run some assertions. The result must be explicitly committed or discarded or else
427
- * the test will fail. A macro may be provided.
428
- */
429
- < Args extends any [ ] > ( fn : [ EitherMacro < Args , Context > , ...Array < EitherMacro < Args , Context > > ] , ...args : Args ) : Promise < TryResult [ ] > ;
430
417
}
431
418
432
419
export interface AssertionError extends Error { }
@@ -483,18 +470,15 @@ export type Macro<Args extends any[], Context = unknown> = UntitledMacro<Args, C
483
470
484
471
export type EitherMacro < Args extends any [ ] , Context > = Macro < Args , Context > | UntitledMacro < Args , Context > ;
485
472
486
- /** Alias for a single macro, or an array of macros. */
487
- export type OneOrMoreMacros < Args extends any [ ] , Context > = EitherMacro < Args , Context > | [ EitherMacro < Args , Context > , ...Array < EitherMacro < Args , Context > > ] ;
488
-
489
473
export interface TestInterface < Context = unknown > {
490
474
/** Declare a concurrent test. */
491
475
( title : string , implementation : Implementation < Context > ) : void ;
492
476
493
- /** Declare a concurrent test that uses one or more macros . Additional arguments are passed to the macro. */
494
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
477
+ /** Declare a concurrent test that uses a macro . Additional arguments are passed to the macro. */
478
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
495
479
496
- /** Declare a concurrent test that uses one or more macros . The macro is responsible for generating a unique test title. */
497
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
480
+ /** Declare a concurrent test that uses a macro . The macro is responsible for generating a unique test title. */
481
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
498
482
499
483
/** Declare a hook that is run once, after all tests have passed. */
500
484
after : AfterInterface < Context > ;
@@ -528,10 +512,10 @@ export interface AfterInterface<Context = unknown> {
528
512
( title : string , implementation : Implementation < Context > ) : void ;
529
513
530
514
/** Declare a hook that is run once, after all tests have passed. Additional arguments are passed to the macro. */
531
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
515
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
532
516
533
517
/** Declare a hook that is run once, after all tests have passed. */
534
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
518
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
535
519
536
520
/** Declare a hook that is run once, after all tests are done. */
537
521
always : AlwaysInterface < Context > ;
@@ -547,10 +531,10 @@ export interface AlwaysInterface<Context = unknown> {
547
531
( title : string , implementation : Implementation < Context > ) : void ;
548
532
549
533
/** Declare a hook that is run once, after all tests are done. Additional arguments are passed to the macro. */
550
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
534
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
551
535
552
536
/** Declare a hook that is run once, after all tests are done. */
553
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
537
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
554
538
555
539
skip : HookSkipInterface < Context > ;
556
540
}
@@ -563,10 +547,10 @@ export interface BeforeInterface<Context = unknown> {
563
547
( title : string , implementation : Implementation < Context > ) : void ;
564
548
565
549
/** Declare a hook that is run once, before all tests. Additional arguments are passed to the macro. */
566
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
550
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
567
551
568
552
/** Declare a hook that is run once, before all tests. */
569
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
553
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
570
554
571
555
skip : HookSkipInterface < Context > ;
572
556
}
@@ -576,16 +560,16 @@ export interface FailingInterface<Context = unknown> {
576
560
( title : string , implementation : Implementation < Context > ) : void ;
577
561
578
562
/**
579
- * Declare a concurrent test that uses one or more macros . Additional arguments are passed to the macro.
563
+ * Declare a concurrent test that uses a macro . Additional arguments are passed to the macro.
580
564
* The test is expected to fail.
581
565
*/
582
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
566
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
583
567
584
568
/**
585
- * Declare a concurrent test that uses one or more macros . The macro is responsible for generating a unique test title.
569
+ * Declare a concurrent test that uses a macro . The macro is responsible for generating a unique test title.
586
570
* The test is expected to fail.
587
571
*/
588
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
572
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
589
573
590
574
only : OnlyInterface < Context > ;
591
575
skip : SkipInterface < Context > ;
@@ -599,40 +583,40 @@ export interface HookSkipInterface<Context = unknown> {
599
583
( title : string , implementation : Implementation < Context > ) : void ;
600
584
601
585
/** Skip this hook. */
602
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
586
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
603
587
604
588
/** Skip this hook. */
605
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
589
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
606
590
}
607
591
608
592
export interface OnlyInterface < Context = unknown > {
609
593
/** Declare a test. Only this test and others declared with `.only()` are run. */
610
594
( title : string , implementation : Implementation < Context > ) : void ;
611
595
612
596
/**
613
- * Declare a test that uses one or more macros . Additional arguments are passed to the macro.
597
+ * Declare a test that uses a macro . Additional arguments are passed to the macro.
614
598
* Only this test and others declared with `.only()` are run.
615
599
*/
616
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
600
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
617
601
618
602
/**
619
- * Declare a test that uses one or more macros . The macro is responsible for generating a unique test title.
603
+ * Declare a test that uses a macro . The macro is responsible for generating a unique test title.
620
604
* Only this test and others declared with `.only()` are run.
621
605
*/
622
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
606
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
623
607
}
624
608
625
609
export interface SerialInterface < Context = unknown > {
626
610
/** Declare a serial test. */
627
611
( title : string , implementation : Implementation < Context > ) : void ;
628
612
629
- /** Declare a serial test that uses one or more macros . Additional arguments are passed to the macro. */
630
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
613
+ /** Declare a serial test that uses a macro . Additional arguments are passed to the macro. */
614
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
631
615
632
616
/**
633
- * Declare a serial test that uses one or more macros . The macro is responsible for generating a unique test title.
617
+ * Declare a serial test that uses a macro . The macro is responsible for generating a unique test title.
634
618
*/
635
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
619
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
636
620
637
621
/** Declare a serial hook that is run once, after all tests have passed. */
638
622
after : AfterInterface < Context > ;
@@ -659,10 +643,10 @@ export interface SkipInterface<Context = unknown> {
659
643
( title : string , implementation : Implementation < Context > ) : void ;
660
644
661
645
/** Skip this test. */
662
- < T extends any [ ] > ( title : string , macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
646
+ < T extends any [ ] > ( title : string , macro : EitherMacro < T , Context > , ...rest : T ) : void ;
663
647
664
648
/** Skip this test. */
665
- < T extends any [ ] > ( macros : OneOrMoreMacros < T , Context > , ...rest : T ) : void ;
649
+ < T extends any [ ] > ( macro : EitherMacro < T , Context > , ...rest : T ) : void ;
666
650
}
667
651
668
652
export interface TodoDeclaration {
0 commit comments