Files
cloudron-box/src/test/acme2-test.js

31 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-10-31 15:41:02 -07:00
/* global it:false */
/* global describe:false */
/* global before:false */
/* global after:false */
'use strict';
2021-06-03 12:20:44 -07:00
const acme2 = require('../acme2.js'),
common = require('./common.js'),
expect = require('expect.js');
2018-10-31 15:41:02 -07:00
describe('Acme2', function () {
2021-08-13 10:41:10 -07:00
const { setup, cleanup } = common;
before(setup);
after(cleanup);
2018-10-31 15:41:02 -07:00
describe('getChallengeSubdomain', function () {
it('non-wildcard', function () {
expect(acme2._getChallengeSubdomain('example.com', 'example.com')).to.be('_acme-challenge');
expect(acme2._getChallengeSubdomain('git.example.com', 'example.com')).to.be('_acme-challenge.git');
});
it('wildcard', function () {
expect(acme2._getChallengeSubdomain('*.example.com', 'example.com')).to.be('_acme-challenge');
expect(acme2._getChallengeSubdomain('*.git.example.com', 'example.com')).to.be('_acme-challenge.git');
expect(acme2._getChallengeSubdomain('*.example.com', 'customer.example.com')).to.be('_acme-challenge');
2018-10-31 15:41:02 -07:00
});
});
});