mirror of
https://github.com/certd/certd.git
synced 2026-04-15 05:00:52 +08:00
chore: 准备打包
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import { AbstractAccess, IAccessService } from "@certd/pipeline";
|
||||
import { aliyunSecret } from "../user.secret";
|
||||
export class AccessServiceTest implements IAccessService {
|
||||
async getById(id: any): Promise<AbstractAccess> {
|
||||
return {
|
||||
...aliyunSecret,
|
||||
} as any;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { FileStorage } from "@certd/pipeline/src/core/storage";
|
||||
import { ContextFactory } from "@certd/pipeline/src/core/context";
|
||||
import { AccessServiceTest } from "@certd/pipeline/test/pipeline/access-service-test";
|
||||
import { logger } from "@certd/pipeline";
|
||||
import { request } from "@certd/pipeline/src/utils/util.request";
|
||||
|
||||
const contextFactory = new ContextFactory(new FileStorage());
|
||||
|
||||
const userContext = contextFactory.getContext("user", "test");
|
||||
const pipelineContext = contextFactory.getContext("pipeline", "test");
|
||||
export const pluginInitProps = {
|
||||
accessService: new AccessServiceTest(),
|
||||
pipelineContext: pipelineContext,
|
||||
userContext: userContext,
|
||||
logger: logger,
|
||||
http: request,
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
import "mocha";
|
||||
import { pluginInitProps } from "../init.test";
|
||||
import { CertApplyPlugin } from "../../../src";
|
||||
describe("CertApply", function () {
|
||||
it("#execute", async function () {
|
||||
this.timeout(120000);
|
||||
const plugin = new CertApplyPlugin();
|
||||
// @ts-ignore
|
||||
delete plugin.define;
|
||||
await plugin.doInit(pluginInitProps);
|
||||
const output = await plugin.execute({
|
||||
domains: ["*.docmirror.cn", "docmirror.cn"],
|
||||
email: "xiaojunnuo@qq.com",
|
||||
dnsProviderType: "aliyun",
|
||||
accessId: "111",
|
||||
forceUpdate: true,
|
||||
});
|
||||
const cert = output.cert;
|
||||
expect(plugin.getDefine().name).eq("CertApply");
|
||||
expect(cert.crt != null).eq(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user