@@ -57,7 +57,7 @@ describe("test triggers", () => {
5757 // should create service in tmp directory
5858 const tmpDir = getTmpDirPath ( ) ;
5959 const serviceName = getServiceName ( runtime . name ) ;
60- createTestService ( tmpDir , oldCwd , {
60+ const config = createTestService ( tmpDir , oldCwd , {
6161 devModuleDir,
6262 templateName : path . resolve ( examplesDir , runtime . name ) ,
6363 serviceName : serviceName ,
@@ -89,18 +89,22 @@ describe("test triggers", () => {
8989
9090 // should create cronjob for function
9191 let deployedApplication ;
92+ let triggerInputs ;
9293 if ( runtime . isFunction ) {
9394 deployedApplication = namespace . functions [ 0 ] ;
95+ triggerInputs = config . functions . first . events [ 0 ] . schedule . input ;
9496 } else {
9597 deployedApplication = namespace . containers [ 0 ] ;
98+ triggerInputs = config . custom . containers . first . events [ 0 ] . schedule . input ;
9699 }
97100 const deployedTriggers = await api
98101 . listTriggersForApplication ( deployedApplication . id , runtime . isFunction )
99102 . catch ( ( err ) => console . error ( err ) ) ;
100103
101104 expect ( deployedTriggers . length ) . toEqual ( 1 ) ;
102- expect ( deployedTriggers [ 0 ] . args . myInput ) . toEqual ( "myValue" ) ;
103- expect ( deployedTriggers [ 0 ] . args . mySecondInput ) . toEqual ( 1 ) ;
105+ for ( const key in triggerInputs ) {
106+ expect ( deployedTriggers [ 0 ] . args [ key ] ) . toEqual ( triggerInputs [ key ] ) ;
107+ }
104108 expect ( deployedTriggers [ 0 ] . schedule ) . toEqual ( "1 * * * *" ) ;
105109
106110 // should remove services from scaleway
0 commit comments