File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/plugins_core/functions Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export const getZisiParameters = ({
3030 featureFlags : zisiFeatureFlags ,
3131 repositoryRoot,
3232 configFileDirectories,
33+ internalSrcFolder : internalFunctionsSrc ,
3334 }
3435}
3536
Original file line number Diff line number Diff line change @@ -522,6 +522,21 @@ test.serial('functions can have a config with different parameters passed to zip
522522 t . snapshot ( normalizeOutput ( output ) )
523523} )
524524
525+ test . serial ( 'internalSrcFolder is passed to zip-it-and-ship-it and helps prefill the generator field' , async ( t ) => {
526+ const zipItAndShipItSpy = sinon . spy ( zipItAndShipIt , 'zipFunctions' )
527+
528+ await new Fixture ( './fixtures/functions_internal_src_folder' ) . withFlags ( { mode : 'buildbot' } ) . runWithBuild ( )
529+ zipItAndShipItSpy . restore ( )
530+ const { args : call1Args } = zipItAndShipItSpy . getCall ( 0 )
531+
532+ const { internalSrcFolder, manifest } = call1Args [ 2 ]
533+ const { functions } = await importJsonFile ( manifest )
534+
535+ t . is ( internalSrcFolder , join ( FIXTURES_DIR , 'functions_internal_src_folder/.netlify/functions-internal' ) )
536+ t . is ( functions [ 0 ] . generator , 'internalFunc' )
537+ t . is ( functions [ 1 ] . generator , undefined )
538+ } )
539+
525540test ( 'Generates a `manifest.json` file when running outside of buildbot' , async ( t ) => {
526541 await removeDir ( `${ FIXTURES_DIR } /functions_internal_manifest/.netlify/functions` )
527542 await new Fixture ( './fixtures/functions_internal_manifest' ) . withFlags ( { mode : 'cli' } ) . runWithBuild ( )
You can’t perform that action at this time.
0 commit comments