Skip to content

Commit b89d77b

Browse files
author
Marvel Mathew
committed
Fix coverage
1 parent 6d41777 commit b89d77b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

spec/PushController.spec.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ describe('PushController', () => {
12591259
const auth = {isMaster: true};
12601260
const pushController = new PushController();
12611261

1262-
const config = new Config(Parse.applicationId);
1262+
let config = Config.get(Parse.applicationId);
12631263

12641264
const pushes = [];
12651265
const pushAdapter = {
@@ -1275,7 +1275,11 @@ describe('PushController', () => {
12751275
beforeEach((done) => {
12761276
reconfigureServer({
12771277
push: {adapter: pushAdapter},
1278-
}).then(done, done.fail);
1278+
})
1279+
.then(() => {
1280+
config = Config.get(Parse.applicationId);
1281+
})
1282+
.then(done, done.fail);
12791283
});
12801284

12811285
it('should throw if both expiration_time and expiration_interval are set', () => {
@@ -1288,10 +1292,13 @@ describe('PushController', () => {
12881292
it('should throw on invalid expiration_interval', () => {
12891293
expect(() => pushController.sendPush({
12901294
expiration_interval: -1
1291-
})).toThrow();
1295+
}, {}, config, auth)).toThrow();
12921296
expect(() => pushController.sendPush({
12931297
expiration_interval: '',
1294-
})).toThrow();
1298+
}, {}, config, auth)).toThrow();
1299+
expect(() => pushController.sendPush({
1300+
expiration_time: {},
1301+
}, {}, config, auth)).toThrow();
12951302
});
12961303

12971304
describe('For immediate pushes',() => {
@@ -1308,7 +1315,7 @@ describe('PushController', () => {
13081315
alert: 'immediate push',
13091316
},
13101317
expiration_interval: 20 * 60, // twenty minutes
1311-
}, {}, new Config(Parse.applicationId), auth, resolve, now)
1318+
}, {}, Config.get(Parse.applicationId), auth, resolve, now)
13121319
}))
13131320
.then((pushStatusId) => {
13141321
const p = new Parse.Object('_PushStatus');

0 commit comments

Comments
 (0)