@@ -125,7 +125,7 @@ describe('plugin:leetcode', function() {
125
125
. get ( '/api/problems/concurrency/' )
126
126
. replyWithFile ( 200 , './test/mock/problems.json.20160911' ) ;
127
127
128
- plugin . getProblems ( function ( e , problems ) {
128
+ plugin . getProblems ( false , function ( e , problems ) {
129
129
assert . equal ( e , null ) ;
130
130
assert . equal ( problems . length , 377 * 4 ) ;
131
131
done ( ) ;
@@ -149,7 +149,7 @@ describe('plugin:leetcode', function() {
149
149
. get ( '/api/problems/concurrency/' )
150
150
. replyWithFile ( 200 , './test/mock/problems.json.20160911' ) ;
151
151
152
- plugin . getProblems ( function ( e , problems ) {
152
+ plugin . getProblems ( false , function ( e , problems ) {
153
153
assert . equal ( e . message , 'unknown error' ) ;
154
154
done ( ) ;
155
155
} ) ;
@@ -192,7 +192,7 @@ describe('plugin:leetcode', function() {
192
192
. post ( '/graphql' )
193
193
. replyWithFile ( 200 , './test/mock/find-the-difference.json.20171216' ) ;
194
194
195
- plugin . getProblem ( PROBLEM , function ( e , problem ) {
195
+ plugin . getProblem ( PROBLEM , false , function ( e , problem ) {
196
196
assert . equal ( e , null ) ;
197
197
assert . equal ( problem . totalAC , '89.7K' ) ;
198
198
assert . equal ( problem . totalSubmit , '175.7K' ) ;
@@ -367,7 +367,7 @@ describe('plugin:leetcode', function() {
367
367
it ( 'should fail if no permission for locked' , function ( done ) {
368
368
PROBLEM . locked = true ;
369
369
370
- plugin . getProblem ( PROBLEM , function ( e , problem ) {
370
+ plugin . getProblem ( PROBLEM , false , function ( e , problem ) {
371
371
assert . equal ( e , 'failed to load locked problem!' ) ;
372
372
done ( ) ;
373
373
} ) ;
@@ -376,7 +376,7 @@ describe('plugin:leetcode', function() {
376
376
it ( 'should fail if session expired' , function ( done ) {
377
377
nock ( 'https://leetcode.com' ) . post ( '/graphql' ) . reply ( 403 ) ;
378
378
379
- plugin . getProblem ( PROBLEM , function ( e , problem ) {
379
+ plugin . getProblem ( PROBLEM , false , function ( e , problem ) {
380
380
assert . equal ( e , session . errors . EXPIRED ) ;
381
381
done ( ) ;
382
382
} ) ;
@@ -385,7 +385,7 @@ describe('plugin:leetcode', function() {
385
385
it ( 'should fail if http error' , function ( done ) {
386
386
nock ( 'https://leetcode.com' ) . post ( '/graphql' ) . reply ( 500 ) ;
387
387
388
- plugin . getProblem ( PROBLEM , function ( e , problem ) {
388
+ plugin . getProblem ( PROBLEM , false , function ( e , problem ) {
389
389
assert . deepEqual ( e , { msg : 'http error' , statusCode : 500 } ) ;
390
390
done ( ) ;
391
391
} ) ;
@@ -394,7 +394,7 @@ describe('plugin:leetcode', function() {
394
394
it ( 'should fail if unknown error' , function ( done ) {
395
395
nock ( 'https://leetcode.com' ) . post ( '/graphql' ) . replyWithError ( 'unknown error!' ) ;
396
396
397
- plugin . getProblem ( PROBLEM , function ( e , problem ) {
397
+ plugin . getProblem ( PROBLEM , false , function ( e , problem ) {
398
398
assert . equal ( e . message , 'unknown error!' ) ;
399
399
done ( ) ;
400
400
} ) ;
0 commit comments