36aa641cb9
also, set no-use-before-define in linter
30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
/* global it:false */
|
|
|
|
import acme2 from '../acme2.js';
|
|
import common from './common.js';
|
|
import expect from 'expect.js';
|
|
|
|
/* global describe:false */
|
|
/* global before:false */
|
|
/* global after:false */
|
|
|
|
describe('Acme2', function () {
|
|
const { setup, cleanup } = common;
|
|
|
|
before(setup);
|
|
after(cleanup);
|
|
|
|
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');
|
|
});
|
|
});
|
|
});
|