refactor: ```

This commit is contained in:
xiaojunnuo
2020-12-19 01:57:52 +08:00
parent 06603759fd
commit df9f561fd3
22 changed files with 276 additions and 103 deletions
@@ -0,0 +1,21 @@
import pkg from 'chai'
import { UploadToAliyunPlugin } from '../../src/aliyun/upload-to-aliyun/index.js'
import options from '../options.js'
import { Certd } from '@certd/certd'
const { expect } = pkg
describe('PluginUploadToAliyun', function () {
it('#execute', async function () {
const plugin = new UploadToAliyunPlugin()
const certd = new Certd()
const cert = certd.readCurrentCert('xiaojunnuo@qq.com', ['*.docmirror.club', 'docmirror.club'])
const context = {}
await plugin.execute({
accessProviders: options.accessProviders,
cert,
args: { name: '上传证书到阿里云测试', provider: 'aliyun' },
context
})
console.log('context:', context)
})
})
+2 -2
View File
@@ -1,7 +1,7 @@
import _ from 'lodash'
import optionsPrivate from './options.private.js'
import optionsPrivate from '../../../test/options.private.mjs'
const defaultOptions = {
providers: {
accessProviders: {
aliyun: {
providerType: 'aliyun',
accessKeyId: '',
@@ -1,17 +0,0 @@
import pkg from 'chai'
import UploadCertToAliyun from '../../src/upload/upload-cert-to-aliyun/index.js'
import options from '../options'
import Certd from '@certd/certd'
const { expect } = pkg
describe('PluginUploadCertToAliyun', function () {
it('#execute', function () {
const plugin = new UploadCertToAliyun()
const certd = new Certd()
const cert = certd.readCurrentCert('xiaojunnuo@qq.com', ['*.docmirror.cn'])
plugin.execute({
providers: options.providers,
cert,
args: { name: '上传证书到阿里云', provider: 'aliyun' }
})
})
})