Throw error when push is missing configuration (#2035)

This commit is contained in:
Marco Cheung
2016-06-14 00:26:02 +08:00
committed by Drew
parent 0ec78d478b
commit 7c8ad7e071
4 changed files with 31 additions and 7 deletions

View File

@@ -144,4 +144,24 @@ describe('Parse.Push', () => {
});
});
});
it('should throw error if missing push configuration', done => {
reconfigureServer({push: null})
.then(() => {
return Parse.Push.send({
where: {
deviceType: 'ios'
},
data: {
badge: 'increment',
alert: 'Hello world!'
}
}, {useMasterKey: true})
}).then((response) => {
fail('should not succeed');
}, (err) => {
expect(err.code).toEqual(Parse.Error.PUSH_MISCONFIGURED);
done();
});
});
});