@@ -7,6 +7,7 @@ import { ManifestEndpoint, ManifestRequiredAPI, ManifestStack } from "../../src/
77import { clearParams } from "../../src/params" ;
88import { MINIMAL_V1_ENDPOINT , MINIMAL_V2_ENDPOINT } from "../fixtures" ;
99import { MINIMAL_SCHEDULE_TRIGGER , MINIMIAL_TASK_QUEUE_TRIGGER } from "../v1/providers/fixtures" ;
10+ import { BooleanParam , IntParam , StringParam } from "../../src/params/types" ;
1011
1112describe ( "extractStack" , ( ) => {
1213 const httpFn = functions . https . onRequest ( ( ) => undefined ) ;
@@ -376,6 +377,45 @@ describe("loadStack", () => {
376377 ] ,
377378 } ,
378379 } ,
380+ {
381+ name : "can use parameterized fields" ,
382+ modulePath : "./spec/fixtures/sources/commonjs-parametrized-fields" ,
383+ expected : {
384+ ...expected ,
385+ params : [
386+ { name : "STRING_PARAM" , type : "string" } ,
387+ { name : "INT_PARAM" , type : "int" } ,
388+ { name : "BOOLEAN_PARAM" , type : "boolean" } ,
389+ ] ,
390+ endpoints : {
391+ v1http : {
392+ ...MINIMAL_V1_ENDPOINT ,
393+ platform : "gcfv1" ,
394+ entryPoint : "v1http" ,
395+ minInstances : new IntParam ( "INT_PARAM" ) ,
396+ maxInstances : new IntParam ( "INT_PARAM" ) ,
397+ availableMemoryMb : new IntParam ( "INT_PARAM" ) ,
398+ timeoutSeconds : new IntParam ( "INT_PARAM" ) ,
399+ serviceAccountEmail : new StringParam ( "STRING_PARAM" ) ,
400+ omit : new BooleanParam ( "BOOLEAN_PARAM" ) ,
401+ httpsTrigger : { } ,
402+ } ,
403+ v2http : {
404+ ...MINIMAL_V2_ENDPOINT ,
405+ platform : "gcfv2" ,
406+ entryPoint : "v2http" ,
407+ minInstances : new IntParam ( "INT_PARAM" ) ,
408+ maxInstances : new IntParam ( "INT_PARAM" ) ,
409+ availableMemoryMb : new IntParam ( "INT_PARAM" ) ,
410+ timeoutSeconds : new IntParam ( "INT_PARAM" ) ,
411+ serviceAccountEmail : new StringParam ( "STRING_PARAM" ) ,
412+ omit : new BooleanParam ( "BOOLEAN_PARAM" ) ,
413+ labels : { } ,
414+ httpsTrigger : { } ,
415+ } ,
416+ } ,
417+ } ,
418+ } ,
379419 ] ;
380420
381421 for ( const tc of testcases ) {
0 commit comments