@@ -2,7 +2,6 @@ import expect from 'must';
2
2
3
3
import Github from '../lib/GitHub' ;
4
4
import testUser from './fixtures/user.json' ;
5
- import { assertSuccessful } from './helpers/callbacks' ;
6
5
7
6
describe ( 'RateLimit' , function ( ) {
8
7
let github ;
@@ -18,18 +17,15 @@ describe('RateLimit', function() {
18
17
rateLimit = github . getRateLimit ( ) ;
19
18
} ) ;
20
19
21
- it ( 'should get rate limit' , function ( done ) {
22
- rateLimit . getRateLimit ( assertSuccessful ( done , function ( err , rateInfo ) {
23
- const rate = rateInfo . rate ;
20
+ it ( 'should get rate limit' , async function ( ) {
21
+ const { data : rateInfo } = await rateLimit . getRateLimit ( ) ;
22
+ const rate = rateInfo . rate ;
24
23
25
- expect ( rate ) . to . be . an . object ( ) ;
26
- expect ( rate ) . to . have . own ( 'limit' ) ;
27
- expect ( rate ) . to . have . own ( 'remaining' ) ;
28
- expect ( rate . limit ) . to . be . a . number ( ) ;
29
- expect ( rate . remaining ) . to . be . a . number ( ) ;
30
- expect ( rate . remaining ) . to . be . at . most ( rateInfo . rate . limit ) ;
31
-
32
- done ( ) ;
33
- } ) ) ;
24
+ expect ( rate ) . to . be . an . object ( ) ;
25
+ expect ( rate ) . to . have . own ( 'limit' ) ;
26
+ expect ( rate ) . to . have . own ( 'remaining' ) ;
27
+ expect ( rate . limit ) . to . be . a . number ( ) ;
28
+ expect ( rate . remaining ) . to . be . a . number ( ) ;
29
+ expect ( rate . remaining ) . to . be . at . most ( rateInfo . rate . limit ) ;
34
30
} ) ;
35
31
} ) ;
0 commit comments