@@ -2,7 +2,6 @@ import { ScfDeployInputs } from './../src/modules/scf/interface';
2
2
import { sleep } from '@ygkit/request' ;
3
3
import { Scf , Cfs , Layer } from '../src' ;
4
4
5
- // FIXME: skip mps test
6
5
describe ( 'Scf' , ( ) => {
7
6
const credentials = {
8
7
SecretId : process . env . TENCENT_SECRET_ID ,
@@ -90,7 +89,8 @@ describe('Scf', () => {
90
89
const events = Object . entries ( triggers ) . map ( ( [ , value ] ) => value ) ;
91
90
92
91
const inputs : ScfDeployInputs = {
93
- name : `serverless-test-${ Date . now ( ) } ` ,
92
+ // name: `serverless-test-${Date.now()}`,
93
+ name : `serverless-test-fixed` ,
94
94
code : {
95
95
bucket : process . env . BUCKET ,
96
96
object : 'express_code.zip' ,
@@ -168,7 +168,7 @@ describe('Scf', () => {
168
168
done ( ) ;
169
169
} ) ;
170
170
171
- test ( 'should deploy SCF success ' , async ( ) => {
171
+ test ( 'deploy' , async ( ) => {
172
172
await sleep ( 3000 ) ;
173
173
outputs = await scf . deploy ( inputs ) ;
174
174
expect ( outputs ) . toEqual ( {
@@ -353,7 +353,7 @@ describe('Scf', () => {
353
353
} ,
354
354
] ) ;
355
355
} ) ;
356
- test ( 'should update SCF success ' , async ( ) => {
356
+ test ( 'update' , async ( ) => {
357
357
await sleep ( 3000 ) ;
358
358
outputs = await scf . deploy ( inputs ) ;
359
359
expect ( outputs ) . toEqual ( {
@@ -538,7 +538,7 @@ describe('Scf', () => {
538
538
} ,
539
539
] ) ;
540
540
} ) ;
541
- test ( 'should invoke Scf success ' , async ( ) => {
541
+ test ( 'invoke' , async ( ) => {
542
542
const res = await scf . invoke ( {
543
543
namespace : inputs . namespace ,
544
544
functionName : inputs . name ,
@@ -557,7 +557,23 @@ describe('Scf', () => {
557
557
RequestId : expect . any ( String ) ,
558
558
} ) ;
559
559
} ) ;
560
- test ( 'should remove Scf success' , async ( ) => {
560
+ test ( 'remove' , async ( ) => {
561
+ const res = await scf . remove ( {
562
+ functionName : inputs . name ,
563
+ ...outputs ,
564
+ } ) ;
565
+ expect ( res ) . toEqual ( true ) ;
566
+ } ) ;
567
+ test ( '[asyncRunEnable and traceEnable] create' , async ( ) => {
568
+ await sleep ( 3000 ) ;
569
+ inputs . asyncRunEnable = true ;
570
+ inputs . traceEnable = true ;
571
+ outputs = await scf . deploy ( inputs ) ;
572
+
573
+ expect ( outputs . AsyncRunEnable ) . toBe ( 'TRUE' ) ;
574
+ expect ( outputs . TraceEnable ) . toBe ( 'TRUE' ) ;
575
+ } ) ;
576
+ test ( '[asyncRunEnable and traceEnable] remove' , async ( ) => {
561
577
const res = await scf . remove ( {
562
578
functionName : inputs . name ,
563
579
...outputs ,
0 commit comments