smartacme/test/test.js

26 lines
1.9 KiB
JavaScript
Raw Normal View History

2016-11-01 17:27:57 +00:00
"use strict";
require("typings-test");
2016-11-01 19:16:43 +00:00
const should = require("should");
// import the module to test
const smartacme = require("../dist/index");
2016-11-01 17:27:57 +00:00
describe('smartacme', function () {
let testAcme;
2016-11-01 19:16:43 +00:00
it('should create a valid instance', function () {
2016-11-11 13:17:50 +00:00
this.timeout(10000);
2016-11-01 19:16:43 +00:00
testAcme = new smartacme.SmartAcme();
should(testAcme).be.instanceOf(smartacme.SmartAcme);
});
2016-11-07 17:41:52 +00:00
it('should have created keyPair', function () {
should(testAcme.acmeUrl).be.of.type('string');
2016-11-07 17:41:52 +00:00
});
2016-11-11 13:17:50 +00:00
it('should register a new account', function (done) {
this.timeout(40000);
2016-11-11 13:17:50 +00:00
testAcme.createAccount().then(x => {
done();
}).catch(err => {
console.log(err);
done(err);
});
2016-11-01 19:16:43 +00:00
});
2016-11-01 17:27:57 +00:00
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQixpQ0FBZ0M7QUFFaEMsNEJBQTRCO0FBQzVCLDJDQUEwQztBQUUxQyxRQUFRLENBQUMsV0FBVyxFQUFFO0lBQ2xCLElBQUksUUFBNkIsQ0FBQTtJQUNqQyxFQUFFLENBQUMsZ0NBQWdDLEVBQUU7UUFDakMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQTtRQUNuQixRQUFRLEdBQUcsSUFBSSxTQUFTLENBQUMsU0FBUyxFQUFFLENBQUE7UUFDcEMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0l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