Skip to content

Commit 10af831

Browse files
committed
Merge pull request #143 from marco-c/test_non_URL_safe_encoding
Explicitly test non URL-safe base64 encoding
2 parents 0619bad + 185ba8c commit 10af831

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/testSendNotification.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,23 @@ suite('sendNotification', function() {
236236
});
237237
});
238238

239+
test('send/receive string (non-urlsafe base64)', function() {
240+
return startServer('hello')
241+
.then(function() {
242+
return webPush.sendNotification('https://127.0.0.1:' + serverPort, {
243+
userPublicKey: userPublicKey.toString('base64'),
244+
userAuth: userAuth.toString('base64'),
245+
payload: 'hello',
246+
});
247+
})
248+
.then(function(body) {
249+
assert(true, 'sendNotification promise resolved');
250+
assert.equal(body, 'ok');
251+
}, function(e) {
252+
assert(false, 'sendNotification promise rejected with: ' + e);
253+
});
254+
});
255+
239256
test('send/receive buffer', function() {
240257
return startServer('hello')
241258
.then(function() {

0 commit comments

Comments
 (0)