Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const dataObject = {
message: 'payload',
badge: 4,
};
const webOptions = {
web: {
vapidDetails: {
subject: 'mailto@me.net',
publicKey: '< URL Safe Base64 Encoded Public Key >',
privateKey: '< URL Safe Base64 Encoded Private Key >',
},
gcmAPIKey: 'gcmKey',
},
};
const pn = new PN(webOptions);
const pushError = new webpush.WebPushError(
'forced error',
400,
{},
'errorBody',
{}
);
const testSuccess = testPushSuccess(method, regIds);
const testError = testPushError(method, regIds, pushError.message);
const testException = testPushException(pushError.message);
let sendMethod;
function sendOkMethodAsString() {
return sinon.stub(webpush, 'sendNotification', (regId, message, settings) => {
expect(regId).to.be.a('object');