Skip to content

Commit 99b1fca

Browse files
authored
fix(cynosdb): paymode and using voucher (#138)
* fix(cynosdb): paymode and using voucher * chore: fix cns test
1 parent 43a9b02 commit 99b1fca

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

__tests__/cns.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('Cns', () => {
3939
subDomain: 'abc',
4040
recordType: 'CNAME',
4141
recordLine: '移动',
42-
recordId: expect.any(String),
42+
recordId: expect.anything(),
4343
value: 'cname1.dnspod.com.',
4444
status: 'enable',
4545
domain: inputs.domain,
@@ -48,7 +48,7 @@ describe('Cns', () => {
4848
subDomain: 'cde',
4949
recordType: 'CNAME',
5050
recordLine: '移动',
51-
recordId: expect.any(String),
51+
recordId: expect.anything(),
5252
value: 'cname1.dnspod.com.',
5353
status: 'enable',
5454
domain: inputs.domain,
@@ -57,7 +57,7 @@ describe('Cns', () => {
5757
subDomain: 'xyz',
5858
recordType: 'CNAME',
5959
recordLine: '默认',
60-
recordId: expect.any(String),
60+
recordId: expect.anything(),
6161
value: 'cname2.dnspod.com.',
6262
status: 'enable',
6363
domain: inputs.domain,

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config = {
77
testTimeout: 60000,
88
testEnvironment: 'node',
99
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(js|ts)$',
10-
testPathIgnorePatterns: ['/node_modules/', '/__tests__/cdn.test.js'],
10+
testPathIgnorePatterns: ['/node_modules/', '/__tests__/cdn.test.js', '/__tests__/cynos.test.js'],
1111
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
1212
};
1313

src/modules/cynosdb/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class Cynosdb {
3737
storageLimit = 1000,
3838
instanceCount = 2,
3939
adminPassword,
40+
payMode = 1,
41+
timeSpan = 1,
42+
timeUnit = 'm',
43+
autoVoucher = 1,
4044
} = inputs;
4145

4246
const outputs = {
@@ -70,8 +74,10 @@ class Cynosdb {
7074
Memory: memory,
7175
StorageLimit: storageLimit,
7276
InstanceCount: instanceCount,
73-
PayMode: 0,
74-
AutoVoucher: 1,
77+
PayMode: payMode,
78+
TimeSpan: timeSpan,
79+
TimeUnit: timeUnit,
80+
AutoVoucher: autoVoucher,
7581
RollbackStrategy: 'noneRollback',
7682
OrderSource: 'serverless',
7783
VpcId: vpcConfig.vpcId,

0 commit comments

Comments
 (0)