@@ -2,7 +2,6 @@ import expect from 'must';
22
33import Github from '../lib/GitHub' ;
44import testUser from './fixtures/user.json' ;
5- import { assertSuccessful } from './helpers/callbacks' ;
65
76describe ( 'RateLimit' , function ( ) {
87 let github ;
@@ -18,18 +17,15 @@ describe('RateLimit', function() {
1817 rateLimit = github . getRateLimit ( ) ;
1918 } ) ;
2019
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 ;
2423
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 ) ;
3430 } ) ;
3531} ) ;
0 commit comments