@@ -39,6 +39,7 @@ describe('preBuild()', () => {
3939 netlifyConfig : { } ,
4040 packageJson,
4141 utils,
42+ constants : { FUNCTIONS_SRC : 'out_functions' } ,
4243 } )
4344
4445 expect ( utils . build . failBuild . mock . calls [ 0 ] [ 0 ] ) . toEqual (
@@ -54,6 +55,7 @@ describe('preBuild()', () => {
5455 netlifyConfig,
5556 packageJson,
5657 utils,
58+ constants : { FUNCTIONS_SRC : 'out_functions' } ,
5759 } )
5860
5961 expect ( utils . build . failBuild . mock . calls [ 0 ] [ 0 ] ) . toEqual (
@@ -62,13 +64,13 @@ describe('preBuild()', () => {
6264 } )
6365
6466 test ( 'fail build if the app has no functions directory defined' , async ( ) => {
65- const netlifyConfig = { build : { } }
6667 const packageJson = { }
6768
6869 await plugin . onPreBuild ( {
69- netlifyConfig,
70+ netlifyConfig : { } ,
7071 packageJson,
7172 utils,
73+ constants : { } ,
7274 } )
7375
7476 expect ( utils . build . failBuild . mock . calls [ 0 ] [ 0 ] ) . toEqual (
@@ -81,23 +83,24 @@ describe('preBuild()', () => {
8183 netlifyConfig : { } ,
8284 packageJson : { } ,
8385 utils,
86+ constants : { FUNCTIONS_SRC : 'out_functions' } ,
8487 } )
8588
8689 expect ( makef . createFile . mock . calls . length ) . toEqual ( 1 )
8790 } )
8891
8992 test ( `fail build if the app's next config has an invalid target` , async ( ) => {
90- const netlifyConfig = { build : { functions : path . resolve ( 'out_functions' ) } }
9193 mockFs ( {
9294 'next.config.js' : {
9395 target : 'nonsense' ,
9496 } ,
9597 } )
9698
9799 await plugin . onPreBuild ( {
98- netlifyConfig,
100+ netlifyConfig : { } ,
99101 packageJson : { } ,
100102 utils,
103+ constants : { FUNCTIONS_SRC : 'out_functions' } ,
101104 } )
102105
103106 mockFs . restore ( )
0 commit comments