Skip to content

Commit

Permalink
Use expect.promise.fromNode to simplify a test helper function.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Aug 20, 2016
1 parent bdef835 commit ed588ee
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/unexpectedMitm.js
Expand Up @@ -83,14 +83,8 @@ describe('unexpectedMitm', function () {
expect.output.preferredWidth = 150;

function createPemCertificate(certOptions) {
return expect.promise(function (resolve, reject) {
pem.createCertificate(function (err, certificateKeys) {
if (err) {
reject(err);
} else {
resolve(certificateKeys);
}
});
return expect.promise.fromNode(function (cb) {
pem.createCertificate(cb);
});
}

Expand Down

0 comments on commit ed588ee

Please sign in to comment.