@@ -578,6 +578,7 @@ QUnit.test("abort", function (assert) {
578
578
this . send = function ( ) { } ;
579
579
this . abort = function ( ) {
580
580
assert . ok ( true , 'called the underlying XHR.abort' ) ;
581
+ restore ( ) ;
581
582
done ( ) ;
582
583
} ;
583
584
} ) ;
@@ -614,7 +615,10 @@ QUnit.test("abort prevents sending if beforeSend is not finished", function (ass
614
615
615
616
request . abort ( ) ;
616
617
617
- setTimeout ( done , 10 ) ;
618
+ setTimeout ( function ( ) {
619
+ restore ( ) ;
620
+ done ( ) ;
621
+ } , 10 ) ;
618
622
} ) ;
619
623
620
624
QUnit . test ( "beforeSend" , function ( assert ) {
@@ -692,7 +696,10 @@ QUnit.test("beforeSend async", function (assert) {
692
696
assert . ok ( headers . hasOwnProperty ( 'Authorization' ) , "authorization header set" ) ;
693
697
} , function ( reason ) {
694
698
assert . notOk ( reason , "request failed with reason = " , reason ) ;
695
- } ) . then ( done ) ;
699
+ } ) . then ( function ( ) {
700
+ restore ( ) ;
701
+ done ( ) ;
702
+ } ) ;
696
703
} ) ;
697
704
698
705
QUnit . test ( "beforeSend rejects the ajax promise on failure" , function ( assert ) {
@@ -720,7 +727,10 @@ QUnit.test("beforeSend rejects the ajax promise on failure", function (assert) {
720
727
} , function ( reason ) {
721
728
assert . ok ( true , "request rejected" ) ;
722
729
assert . equal ( reason , error , "error is what we expect" ) ;
723
- } ) . then ( done ) ;
730
+ } ) . then ( function ( ) {
731
+ restore ( ) ;
732
+ done ( ) ;
733
+ } ) ;
724
734
} ) ;
725
735
726
736
QUnit . test ( "async should be always true #51" , function ( assert ) {
@@ -742,7 +752,7 @@ QUnit.test("async should be always true #51", function(assert){
742
752
headers [ header ] = value ;
743
753
} ;
744
754
} ) ;
745
-
755
+
746
756
ajax ( {
747
757
type : "get" ,
748
758
url : "/ep"
0 commit comments