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'),
|
2020-08-15 18:40:59 -07:00
|
|
|
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');
|
2020-08-15 18:40:59 -07:00
|
|
|
expect(acme2._getChallengeSubdomain('*.example.com', 'customer.example.com')).to.be('_acme-challenge');
|
2018-10-31 15:41:02 -07:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|