Skip to content

Commit 941519a

Browse files
committed
Fix callback inside promise + start making tests more robust.
1 parent 4fc2c71 commit 941519a

File tree

6 files changed

+532
-33
lines changed

6 files changed

+532
-33
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: "node_js"
22
node_js:
3-
- "13"
3+
- "15"
4+
- "14"
45
- "12"
56
- "11"
67
- "10"

lib/protocol/V1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function pk(cb) {
5151
// minor hack to mimic php api without circular dependency - probably a better way to do this
5252
const PrivateKey = require('../key/private');
5353
const pk = new PrivateKey(new V1());
54-
return pk.generate((err) => {
54+
return pk.generate().then((err) => {
5555
if (err) { return done(err); }
5656
return done(null, pk);
5757
});
@@ -76,7 +76,7 @@ function sk(cb) {
7676
// minor hack to mimic php api without circular dependency - probably a better way to do this
7777
const SymmetricKey = require('../key/symmetric');
7878
const sk = new SymmetricKey(new V1());
79-
return sk.generate((err) => {
79+
return sk.generate().then((err) => {
8080
if (err) { return done(err); }
8181
return done(null, sk);
8282
});

lib/protocol/V2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function pk(cb) {
4343
// minor hack to mimic php api without circular dependency - probably a better way to do this
4444
const PrivateKey = require('../key/private');
4545
const pk = new PrivateKey(new V2());
46-
return pk.generate((err) => {
46+
return pk.generate().then((err) => {
4747
if (err) { return done(err); }
4848
return done(null, pk);
4949
});
@@ -68,7 +68,7 @@ function sk(cb) {
6868
// minor hack to mimic php api without circular dependency - probably a better way to do this
6969
const SymmetricKey = require('../key/symmetric');
7070
const sk = new SymmetricKey(new V2());
71-
return sk.generate((err) => {
71+
return sk.generate().then((err) => {
7272
if (err) { return done(err); }
7373
return done(null, sk);
7474
});

0 commit comments

Comments
 (0)