@@ -523,7 +523,7 @@ describe("redis plugin", function() {
523
523
var plugin ;
524
524
var context ;
525
525
526
- it ( "uploads the index" , function ( ) {
526
+ it ( "uploads the index" , async function ( ) {
527
527
plugin = subject . createDeployPlugin ( {
528
528
name : "redis"
529
529
} ) ;
@@ -550,14 +550,13 @@ describe("redis plugin", function() {
550
550
plugin . beforeHook ( context ) ;
551
551
plugin . configure ( context ) ;
552
552
553
- return assert . isFulfilled ( plugin . upload ( context ) ) . then ( function ( result ) {
554
- assert . deepEqual ( result , { redisKey : "test-prefix:123abc" } ) ;
555
- } ) ;
553
+ let result = await assert . isFulfilled ( plugin . upload ( context ) ) ;
554
+ assert . deepEqual ( result , { redisKey : "test-prefix:123abc" } ) ;
556
555
} ) ;
557
556
} ) ;
558
557
559
558
describe ( "activate hook" , function ( ) {
560
- it ( "activates revision" , function ( ) {
559
+ it ( "activates revision" , async function ( ) {
561
560
var activateCalled = false ;
562
561
563
562
var plugin = subject . createDeployPlugin ( {
@@ -585,15 +584,12 @@ describe("redis plugin", function() {
585
584
} ;
586
585
plugin . beforeHook ( context ) ;
587
586
588
- return assert
589
- . isFulfilled ( plugin . activate ( context ) )
590
- . then ( function ( result ) {
591
- assert . ok ( activateCalled ) ;
592
- assert . equal ( result . revisionData . activatedRevisionKey , "123abc" ) ;
593
- } ) ;
587
+ let result = await assert . isFulfilled ( plugin . activate ( context ) ) ;
588
+ assert . ok ( activateCalled ) ;
589
+ assert . equal ( result . revisionData . activatedRevisionKey , "123abc" ) ;
594
590
} ) ;
595
591
596
- it ( "rejects if an error is thrown when activating" , function ( ) {
592
+ it ( "rejects if an error is thrown when activating" , async function ( ) {
597
593
var plugin = subject . createDeployPlugin ( {
598
594
name : "redis"
599
595
} ) ;
@@ -619,9 +615,8 @@ describe("redis plugin", function() {
619
615
} ;
620
616
621
617
plugin . beforeHook ( context ) ;
622
- return assert . isRejected ( plugin . activate ( context ) ) . then ( function ( error ) {
623
- assert . equal ( error , "some-error" ) ;
624
- } ) ;
618
+ let error = await assert . isRejected ( plugin . activate ( context ) ) ;
619
+ assert . equal ( error , "some-error" ) ;
625
620
} ) ;
626
621
} ) ;
627
622
describe ( "didDeploy hook" , function ( ) {
@@ -666,7 +661,7 @@ describe("redis plugin", function() {
666
661
} ) ;
667
662
668
663
describe ( "fetchInitialRevisions hook" , function ( ) {
669
- it ( "fills the initialRevisions variable on context" , function ( ) {
664
+ it ( "fills the initialRevisions variable on context" , async function ( ) {
670
665
var plugin ;
671
666
var context ;
672
667
@@ -701,23 +696,20 @@ describe("redis plugin", function() {
701
696
plugin . beforeHook ( context ) ;
702
697
plugin . configure ( context ) ;
703
698
704
- return assert
705
- . isFulfilled ( plugin . fetchInitialRevisions ( context ) )
706
- . then ( function ( result ) {
707
- assert . deepEqual ( result , {
708
- initialRevisions : [
709
- {
710
- active : false ,
711
- revision : "a"
712
- }
713
- ]
714
- } ) ;
715
- } ) ;
699
+ let result = await assert . isFulfilled ( plugin . fetchInitialRevisions ( context ) ) ;
700
+ assert . deepEqual ( result , {
701
+ initialRevisions : [
702
+ {
703
+ active : false ,
704
+ revision : "a"
705
+ }
706
+ ]
707
+ } ) ;
716
708
} ) ;
717
709
} ) ;
718
710
719
711
describe ( "fetchRevisions hook" , function ( ) {
720
- it ( "fills the revisions variable on context" , function ( ) {
712
+ it ( "fills the revisions variable on context" , async function ( ) {
721
713
var plugin ;
722
714
var context ;
723
715
@@ -752,18 +744,15 @@ describe("redis plugin", function() {
752
744
plugin . beforeHook ( context ) ;
753
745
plugin . configure ( context ) ;
754
746
755
- return assert
756
- . isFulfilled ( plugin . fetchRevisions ( context ) )
757
- . then ( function ( result ) {
758
- assert . deepEqual ( result , {
759
- revisions : [
760
- {
761
- active : false ,
762
- revision : "a"
763
- }
764
- ]
765
- } ) ;
766
- } ) ;
747
+ let result = await assert . isFulfilled ( plugin . fetchRevisions ( context ) ) ;
748
+ assert . deepEqual ( result , {
749
+ revisions : [
750
+ {
751
+ active : false ,
752
+ revision : "a"
753
+ }
754
+ ]
755
+ } ) ;
767
756
} ) ;
768
757
} ) ;
769
758
} ) ;
0 commit comments