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

30 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-10-31 15:41:02 -07:00
/* global it:false */
2026-02-14 15:43:24 +01:00
import acme2 from '../acme2.js';
import common from './common.js';
import expect from 'expect.js';
2018-10-31 15:41:02 -07:00
/* global describe:false */
/* global before:false */
/* global after:false */
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
});
});
});