@@ -78,44 +78,48 @@ describe('Test api', () => {
78
78
}
79
79
80
80
let api ;
81
- test ( 'API v2 service works without auth token' , ( ) => {
82
- api = getApi ( 'V2' ) ;
81
+ test ( 'API v2 service works without auth token' , async ( ) => {
82
+ api = await getApi ( 'V2' ) ;
83
83
return testApi ( api , config . API . V2 ) ;
84
84
} ) ;
85
85
86
- test ( 'API v2 service works with auth token' , ( ) => {
87
- api = getApi ( 'V2' , 'TOKEN' ) ;
86
+ test ( 'API v2 service works with auth token' , async ( ) => {
87
+ api = await getApi ( 'V2' , 'TOKEN' ) ;
88
88
return testApi ( api , config . API . V2 , 'TOKEN' ) ;
89
89
} ) ;
90
90
91
91
test (
92
- 'API v2 service from the previous call is re-used, if token is the same' ,
93
- ( ) => expect ( getApi ( 'V2' , 'TOKEN' ) ) . toBe ( api ) ,
92
+ 'API v2 service from the previous call is re-used, if token is the same' , async ( ) => {
93
+ const api2 = await getApi ( 'V2' , 'TOKEN' ) ;
94
+ expect ( api2 ) . toBe ( api ) ;
95
+ } ,
94
96
) ;
95
97
96
- test ( 'New API v2 service is created if token is new' , ( ) => {
97
- const api2 = getApi ( 'V2' , 'TOKEN2' ) ;
98
+ test ( 'New API v2 service is created if token is new' , async ( ) => {
99
+ const api2 = await getApi ( 'V2' , 'TOKEN2' ) ;
98
100
expect ( api2 ) . not . toBe ( api ) ;
99
101
return testApi ( api2 , config . API . V2 , 'TOKEN2' ) ;
100
102
} ) ;
101
103
102
- test ( 'API v3 service works without auth token' , ( ) => {
103
- api = getApi ( 'V3' ) ;
104
+ test ( 'API v3 service works without auth token' , async ( ) => {
105
+ api = await getApi ( 'V3' ) ;
104
106
return testApi ( api , config . API . V3 ) ;
105
107
} ) ;
106
108
107
- test ( 'API v3 service works with auth token' , ( ) => {
108
- api = getApi ( 'V3' , 'TOKEN' ) ;
109
+ test ( 'API v3 service works with auth token' , async ( ) => {
110
+ api = await getApi ( 'V3' , 'TOKEN' ) ;
109
111
return testApi ( api , config . API . V3 , 'TOKEN' ) ;
110
112
} ) ;
111
113
112
114
test (
113
- 'API v3 service from the previous call is re-used, if token is the same' ,
114
- ( ) => expect ( getApi ( 'V3' , 'TOKEN' ) ) . toBe ( api ) ,
115
+ 'API v3 service from the previous call is re-used, if token is the same' , async ( ) => {
116
+ const api2 = await getApi ( 'V3' , 'TOKEN' ) ;
117
+ return expect ( api2 ) . toBe ( api ) ;
118
+ } ,
115
119
) ;
116
120
117
- test ( 'New API v3 service is created if token is new' , ( ) => {
118
- const api2 = getApi ( 'V3' , 'TOKEN2' ) ;
121
+ test ( 'New API v3 service is created if token is new' , async ( ) => {
122
+ const api2 = await getApi ( 'V3' , 'TOKEN2' ) ;
119
123
expect ( api2 ) . not . toBe ( api ) ;
120
124
return testApi ( api2 , config . API . V3 , 'TOKEN2' ) ;
121
125
} ) ;
0 commit comments