Skip to content

Commit 90e21a5

Browse files
Updated test scripts to run tests in sub folders and updated failing tests (#100)
* updated test scripts to include full test folder * updated unit tests * added missing setter method for targetContentIdentifier property * updated unit tests * reverted change to test file
1 parent 406ce20 commit 90e21a5

File tree

6 files changed

+115
-102
lines changed

6 files changed

+115
-102
lines changed

lib/notification/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Notification.prototype = require('./apsProperties');
4848
'category',
4949
'threadId',
5050
'interruptionLevel',
51+
'targetContentIdentifier',
5152
].forEach(propName => {
5253
const methodName = 'set' + propName[0].toUpperCase() + propName.slice(1);
5354
Notification.prototype[methodName] = function (value) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
"access": "public"
4040
},
4141
"scripts": {
42-
"coverage": "node_modules/.bin/nyc --reporter=lcov node_modules/.bin/mocha",
42+
"coverage": "node_modules/.bin/nyc --reporter=lcov node_modules/.bin/mocha 'test/**/*.js'",
4343
"lint": "npm run eslint && npm run prettier",
4444
"eslint": "eslint .",
4545
"prettier": "prettier --write {lib,test,examples,mock}/{**/*,*}.js index.js",
46-
"test": "node_modules/.bin/mocha"
46+
"test": "node_modules/.bin/mocha 'test/**/*.js'"
4747
},
4848
"jshintConfig": {
4949
"node": true

test/credentials/certificate/parse.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe('parseCredentials', function () {
4747
.withArgs('encryptedPfxData', 'apntest')
4848
.returns({ key: pfxKey, certificates: [pfxCert] });
4949
fakes.parsePkcs12
50-
.withArgs('encryptedPfxData', sinon.match.any)
5150
.throws(new Error('unable to read credentials, incorrect passphrase'));
5251
});
5352

@@ -81,9 +80,7 @@ describe('parseCredentials', function () {
8180
describe('having passphrase', function () {
8281
beforeEach(function () {
8382
fakes.parsePemKey.withArgs('encryptedPemKeyData', 'apntest').returns(pemKey);
84-
fakes.parsePemKey
85-
.withArgs('encryptedPemKeyData', sinon.match.any)
86-
.throws(new Error('unable to load key, incorrect passphrase'));
83+
fakes.parsePemKey.throws(new Error('unable to load key, incorrect passphrase'));
8784
});
8885

8986
it('returns the parsed key', function () {

test/credentials/certificate/prepare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('perpareCertificate', function () {
8080
});
8181

8282
it('contains the CA data', function () {
83-
return expect(credentials).to.have.deep.property('ca[0]', 'myCaData');
83+
return expect(credentials).to.have.nested.deep.property('ca[0]', 'myCaData');
8484
});
8585

8686
it('includes passphrase', function () {

0 commit comments

Comments
 (0)