@@ -1259,7 +1259,7 @@ describe('PushController', () => {
1259
1259
const auth = { isMaster : true } ;
1260
1260
const pushController = new PushController ( ) ;
1261
1261
1262
- const config = new Config ( Parse . applicationId ) ;
1262
+ let config = Config . get ( Parse . applicationId ) ;
1263
1263
1264
1264
const pushes = [ ] ;
1265
1265
const pushAdapter = {
@@ -1275,7 +1275,11 @@ describe('PushController', () => {
1275
1275
beforeEach ( ( done ) => {
1276
1276
reconfigureServer ( {
1277
1277
push : { adapter : pushAdapter } ,
1278
- } ) . then ( done , done . fail ) ;
1278
+ } )
1279
+ . then ( ( ) => {
1280
+ config = Config . get ( Parse . applicationId ) ;
1281
+ } )
1282
+ . then ( done , done . fail ) ;
1279
1283
} ) ;
1280
1284
1281
1285
it ( 'should throw if both expiration_time and expiration_interval are set' , ( ) => {
@@ -1288,10 +1292,13 @@ describe('PushController', () => {
1288
1292
it ( 'should throw on invalid expiration_interval' , ( ) => {
1289
1293
expect ( ( ) => pushController . sendPush ( {
1290
1294
expiration_interval : - 1
1291
- } ) ) . toThrow ( ) ;
1295
+ } , { } , config , auth ) ) . toThrow ( ) ;
1292
1296
expect ( ( ) => pushController . sendPush ( {
1293
1297
expiration_interval : '' ,
1294
- } ) ) . toThrow ( ) ;
1298
+ } , { } , config , auth ) ) . toThrow ( ) ;
1299
+ expect ( ( ) => pushController . sendPush ( {
1300
+ expiration_time : { } ,
1301
+ } , { } , config , auth ) ) . toThrow ( ) ;
1295
1302
} ) ;
1296
1303
1297
1304
describe ( 'For immediate pushes' , ( ) => {
@@ -1308,7 +1315,7 @@ describe('PushController', () => {
1308
1315
alert : 'immediate push' ,
1309
1316
} ,
1310
1317
expiration_interval : 20 * 60 , // twenty minutes
1311
- } , { } , new Config ( Parse . applicationId ) , auth , resolve , now )
1318
+ } , { } , Config . get ( Parse . applicationId ) , auth , resolve , now )
1312
1319
} ) )
1313
1320
. then ( ( pushStatusId ) => {
1314
1321
const p = new Parse . Object ( '_PushStatus' ) ;
0 commit comments