certd/packages/core/executor/test/index.test.js

43 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-12-20 16:32:17 +00:00
import pkg from 'chai'
2021-02-08 06:00:28 +00:00
import { Executor } from '../src/index.js'
2021-02-07 16:21:36 +00:00
import { createOptions } from '../../../../test/options.js'
2021-02-08 06:00:28 +00:00
import PluginAliyun from '@certd/plugin-aliyun'
import PluginTencent from '@certd/plugin-tencent'
import PluginHost from '@certd/plugin-host'
2020-12-20 16:32:17 +00:00
const { expect } = pkg
2021-02-08 06:00:28 +00:00
// 安装默认插件和授权提供者
PluginAliyun.install()
PluginTencent.install()
PluginHost.install()
2020-12-20 16:32:17 +00:00
describe('AutoDeploy', function () {
it('#run', async function () {
2021-01-08 08:59:53 +00:00
this.timeout(120000)
2020-12-25 17:37:53 +00:00
const options = createOptions()
2020-12-20 16:32:17 +00:00
const executor = new Executor()
const ret = await executor.run(options)
expect(ret).ok
expect(ret.cert).ok
})
it('#forceCert', async function () {
2021-01-08 08:59:53 +00:00
this.timeout(120000)
2020-12-20 16:32:17 +00:00
const executor = new Executor()
2020-12-25 17:37:53 +00:00
const options = createOptions()
2021-01-14 15:04:47 +00:00
options.args.forceCert = true
options.args.forceDeploy = true
const ret = await executor.run(options)
2020-12-20 16:32:17 +00:00
expect(ret).ok
expect(ret.cert).ok
})
it('#forceDeploy', async function () {
2021-01-08 08:59:53 +00:00
this.timeout(120000)
2020-12-20 16:32:17 +00:00
const executor = new Executor()
2020-12-25 17:37:53 +00:00
const options = createOptions()
const ret = await executor.run(options, { forceCert: false, forceDeploy: true, forceRedeploy: true })
2020-12-20 16:32:17 +00:00
expect(ret).ok
expect(ret.cert).ok
})
})