38 lines
2.7 KiB
JavaScript
38 lines
2.7 KiB
JavaScript
"use strict";
|
|
require("typings-test");
|
|
const should = require("should");
|
|
// import the module to test
|
|
const smartacme = require("../dist/index");
|
|
describe('smartacme', function () {
|
|
let testAcme;
|
|
it('should create a valid instance', function () {
|
|
this.timeout(10000);
|
|
testAcme = new smartacme.SmartAcme();
|
|
should(testAcme).be.instanceOf(smartacme.SmartAcme);
|
|
});
|
|
it('should have created keyPair', function () {
|
|
should(testAcme.acmeUrl).be.of.type('string');
|
|
});
|
|
it('should register a new account', function (done) {
|
|
this.timeout(10000);
|
|
testAcme.createAccount().then(x => {
|
|
done();
|
|
}).catch(err => {
|
|
console.log(err);
|
|
done(err);
|
|
});
|
|
});
|
|
it('should agree to ToS', function (done) {
|
|
this.timeout(10000);
|
|
testAcme.agreeTos().then(() => {
|
|
done();
|
|
});
|
|
});
|
|
it('should request a challenge for a domain', function (done) {
|
|
this.timeout(10000);
|
|
testAcme.requestChallenge('bleu.de').then(() => {
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQixpQ0FBZ0M7QUFFaEMsNEJBQTRCO0FBQzVCLDJDQUEwQztBQUUxQyxRQUFRLENBQUMsV0FBVyxFQUFFO0lBQ2xCLElBQUksUUFBNkIsQ0FBQTtJQUVqQyxFQUFFLENBQUMsZ0NBQWdDLEVBQUU7UUFDakMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQTtRQUNuQixRQUFRLEdBQUcsSUFBSSxTQUFTLENBQUMsU0FBUyxFQUFFLENBQUE7UUFDcEMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxVQUFVLEN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