@@ -2,7 +2,6 @@ import { ScfDeployInputs } from './../src/modules/scf/interface';
22import { sleep } from '@ygkit/request' ;
33import { Scf , Cfs , Layer } from '../src' ;
44
5- // FIXME: skip mps test
65describe ( 'Scf' , ( ) => {
76 const credentials = {
87 SecretId : process . env . TENCENT_SECRET_ID ,
@@ -90,7 +89,8 @@ describe('Scf', () => {
9089 const events = Object . entries ( triggers ) . map ( ( [ , value ] ) => value ) ;
9190
9291 const inputs : ScfDeployInputs = {
93- name : `serverless-test-${ Date . now ( ) } ` ,
92+ // name: `serverless-test-${Date.now()}`,
93+ name : `serverless-test-fixed` ,
9494 code : {
9595 bucket : process . env . BUCKET ,
9696 object : 'express_code.zip' ,
@@ -168,7 +168,7 @@ describe('Scf', () => {
168168 done ( ) ;
169169 } ) ;
170170
171- test ( 'should deploy SCF success ' , async ( ) => {
171+ test ( 'deploy' , async ( ) => {
172172 await sleep ( 3000 ) ;
173173 outputs = await scf . deploy ( inputs ) ;
174174 expect ( outputs ) . toEqual ( {
@@ -353,7 +353,7 @@ describe('Scf', () => {
353353 } ,
354354 ] ) ;
355355 } ) ;
356- test ( 'should update SCF success ' , async ( ) => {
356+ test ( 'update' , async ( ) => {
357357 await sleep ( 3000 ) ;
358358 outputs = await scf . deploy ( inputs ) ;
359359 expect ( outputs ) . toEqual ( {
@@ -538,7 +538,7 @@ describe('Scf', () => {
538538 } ,
539539 ] ) ;
540540 } ) ;
541- test ( 'should invoke Scf success ' , async ( ) => {
541+ test ( 'invoke' , async ( ) => {
542542 const res = await scf . invoke ( {
543543 namespace : inputs . namespace ,
544544 functionName : inputs . name ,
@@ -557,7 +557,23 @@ describe('Scf', () => {
557557 RequestId : expect . any ( String ) ,
558558 } ) ;
559559 } ) ;
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 ( ) => {
561577 const res = await scf . remove ( {
562578 functionName : inputs . name ,
563579 ...outputs ,
0 commit comments