Skip to content

Commit f45d9de

Browse files
committed
chore: format test codes
1 parent c0dc39b commit f45d9de

File tree

15 files changed

+105
-105
lines changed

15 files changed

+105
-105
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
CHANGELOG.md
2-
*.test.js

__tests__/apigw.test.js

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -106,53 +106,60 @@ describe('apigw', () => {
106106
subDomain: expect.stringContaining('.apigw.tencentcs.com'),
107107
protocols: inputs.protocols,
108108
environment: 'release',
109-
apiList: [{
110-
path: '/',
111-
bindType: 'API',
112-
internalDomain: null,
113-
method: 'GET',
114-
apiName: 'index',
115-
apiId: expect.stringContaining('api-'),
116-
created: true,
117-
usagePlan: {
109+
apiList: [
110+
{
111+
path: '/',
112+
bindType: 'API',
113+
internalDomain: null,
114+
method: 'GET',
115+
apiName: 'index',
116+
apiId: expect.stringContaining('api-'),
118117
created: true,
119-
secrets: {
120-
'created': false,
121-
'secretIds': [],
118+
usagePlan: {
119+
created: true,
120+
secrets: {
121+
created: false,
122+
secretIds: [],
123+
},
124+
usagePlanId: expect.stringContaining('usagePlan-'),
122125
},
123-
usagePlanId: expect.stringContaining('usagePlan-'),
124126
},
125-
},{
126-
path: '/mo',
127-
method: 'GET',
128-
apiName: 'mo',
129-
internalDomain: null,
130-
apiId: expect.stringContaining('api-'),
131-
created: true,
132-
},{
133-
path: '/auto',
134-
method: 'GET',
135-
apiName: 'auto-http',
136-
internalDomain: null,
137-
apiId: expect.stringContaining('api-'),
138-
created: true,
139-
},{
140-
path: '/ws',
141-
method: 'GET',
142-
apiName: 'ws-test',
143-
internalDomain: null,
144-
apiId: expect.stringContaining('api-'),
145-
created: true,
146-
},{
147-
path: '/wsf',
148-
method: 'GET',
149-
apiName: 'ws-scf',
150-
internalDomain: expect.stringContaining('http://set-websocket.cb-common.apigateway.tencentyun.com'),
151-
apiId: expect.stringContaining('api-'),
152-
created: true,
153-
}],
127+
{
128+
path: '/mo',
129+
method: 'GET',
130+
apiName: 'mo',
131+
internalDomain: null,
132+
apiId: expect.stringContaining('api-'),
133+
created: true,
134+
},
135+
{
136+
path: '/auto',
137+
method: 'GET',
138+
apiName: 'auto-http',
139+
internalDomain: null,
140+
apiId: expect.stringContaining('api-'),
141+
created: true,
142+
},
143+
{
144+
path: '/ws',
145+
method: 'GET',
146+
apiName: 'ws-test',
147+
internalDomain: null,
148+
apiId: expect.stringContaining('api-'),
149+
created: true,
150+
},
151+
{
152+
path: '/wsf',
153+
method: 'GET',
154+
apiName: 'ws-scf',
155+
internalDomain: expect.stringContaining(
156+
'http://set-websocket.cb-common.apigateway.tencentyun.com',
157+
),
158+
apiId: expect.stringContaining('api-'),
159+
created: true,
160+
},
161+
],
154162
});
155-
156163
});
157164

158165
test('should remove apigw success', async () => {
@@ -165,4 +172,3 @@ describe('apigw', () => {
165172
expect(detail).toBeNull();
166173
});
167174
});
168-

__tests__/cam.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ describe('Cam', () => {
4242
expect(res).toBe(true);
4343
});
4444
});
45-

__tests__/cdn.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ describe('Cdn', () => {
1212
area: 'overseas',
1313
domain: process.env.SUB_DOMAIN,
1414
origin: {
15-
origins: [`${process.env.BUCKET}-${process.env.TENCENT_APP_ID}.cos.${process.env.REGION}.myqcloud.com`],
15+
origins: [
16+
`${process.env.BUCKET}-${process.env.TENCENT_APP_ID}.cos.${process.env.REGION}.myqcloud.com`,
17+
],
1618
originType: 'cos',
1719
originPullProtocol: 'https',
1820
},
@@ -44,7 +46,6 @@ describe('Cdn', () => {
4446
});
4547
});
4648

47-
4849
test('should deploy CDN success with originType = domain', async () => {
4950
inputs.origin.originType = 'domain';
5051
const res = await cdn.deploy(inputs);
@@ -65,4 +66,3 @@ describe('Cdn', () => {
6566
expect(detail).toBeUndefined();
6667
});
6768
});
68-

__tests__/cfs.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ describe('Cfs', () => {
4141
expect(detail).toBeUndefined();
4242
});
4343
});
44-

__tests__/cns.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@ describe('Cns', () => {
7171
expect(res).toEqual(true);
7272
});
7373
});
74-

__tests__/cos.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('Cos', () => {
3434
],
3535
};
3636

37-
const websiteInputs = {
37+
const websiteInputs = {
3838
code: {
3939
src: staticPath,
4040
},
@@ -75,4 +75,3 @@ describe('Cos', () => {
7575
}
7676
});
7777
});
78-

__tests__/domain.test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@ describe('Domain', () => {
1414
subDomain: expect.any(String),
1515
});
1616
});
17-
1817
});
19-
20-

__tests__/error.test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ const { TypeError, ApiError } = require('../src/utils/error');
33
describe('Custom Error', () => {
44
test('TypeError', async () => {
55
try {
6-
throw new TypeError('TEST_TypeError', 'This is a test error', 'error stack', 123, 'error test');
6+
throw new TypeError(
7+
'TEST_TypeError',
8+
'This is a test error',
9+
'error stack',
10+
123,
11+
'error test',
12+
);
713
} catch (e) {
814
expect(e.type).toEqual('TEST_TypeError');
915
expect(e.message).toEqual('This is a test error');
@@ -32,4 +38,3 @@ describe('Custom Error', () => {
3238
}
3339
});
3440
});
35-

__tests__/layer.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe('Layer', () => {
3030
});
3131

3232
inputs.version = res.version;
33-
3433
});
3534

3635
test('should remove layer success', async () => {
@@ -43,7 +42,4 @@ describe('Layer', () => {
4342
const detail = await layer.getLayerDetail(inputs.name, inputs.version);
4443
expect(detail).toBeNull();
4544
});
46-
4745
});
48-
49-

0 commit comments

Comments
 (0)