@@ -7,7 +7,7 @@ describe('Scf - special', () => {
7
7
SecretId : process . env . TENCENT_SECRET_ID ,
8
8
SecretKey : process . env . TENCENT_SECRET_KEY ,
9
9
} ;
10
- const scf = new Scf ( credentials , 'ap-guangzhou' ) ;
10
+ const client = new Scf ( credentials , 'ap-guangzhou' ) ;
11
11
12
12
const triggers = {
13
13
apigw : {
@@ -66,9 +66,13 @@ describe('Scf - special', () => {
66
66
67
67
let outputs ;
68
68
69
+ test ( 'get demo addresss' , async ( ) => {
70
+ const res = await client . scf . getDemoAddress ( 'demo-nhbwbsi4' ) ;
71
+ expect ( res ) . toContain ( `https://` ) ;
72
+ } ) ;
69
73
test ( 'should deploy SCF success' , async ( ) => {
70
74
await sleep ( 3000 ) ;
71
- outputs = await scf . deploy ( inputs ) ;
75
+ outputs = await client . deploy ( inputs ) ;
72
76
expect ( outputs . FunctionName ) . toBe ( inputs . name ) ;
73
77
expect ( outputs . Qualifier ) . toBe ( '$LATEST' ) ;
74
78
expect ( outputs . Description ) . toBe ( 'Created by Serverless' ) ;
@@ -80,7 +84,7 @@ describe('Scf - special', () => {
80
84
} ) ;
81
85
test ( 'should update SCF success' , async ( ) => {
82
86
await sleep ( 3000 ) ;
83
- outputs = await scf . deploy ( inputs ) ;
87
+ outputs = await client . deploy ( inputs ) ;
84
88
expect ( outputs . FunctionName ) . toBe ( inputs . name ) ;
85
89
expect ( outputs . Qualifier ) . toBe ( '$LATEST' ) ;
86
90
expect ( outputs . Description ) . toBe ( 'Created by Serverless' ) ;
@@ -93,13 +97,13 @@ describe('Scf - special', () => {
93
97
test ( '[ignoreTriggers = true] update' , async ( ) => {
94
98
await sleep ( 3000 ) ;
95
99
inputs . ignoreTriggers = true ;
96
- outputs = await scf . deploy ( inputs ) ;
100
+ outputs = await client . deploy ( inputs ) ;
97
101
98
102
// expect triggers result
99
103
expect ( outputs . Triggers ) . toEqual ( [ ] ) ;
100
104
} ) ;
101
105
test ( 'should remove Scf success' , async ( ) => {
102
- const res = await scf . remove ( {
106
+ const res = await client . remove ( {
103
107
functionName : inputs . name ,
104
108
...outputs ,
105
109
} ) ;
0 commit comments