File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,30 @@ describe('webpack config', () => {
380380 ) ;
381381 } ) ;
382382
383+ it ( 'injects user config file into `_error` in server bundle but not client bundle' , async ( ) => {
384+ const finalServerWebpackConfig = await materializeFinalWebpackConfig ( {
385+ userNextConfig,
386+ incomingWebpackConfig : serverWebpackConfig ,
387+ incomingWebpackBuildContext : serverBuildContext ,
388+ } ) ;
389+ const finalClientWebpackConfig = await materializeFinalWebpackConfig ( {
390+ userNextConfig,
391+ incomingWebpackConfig : clientWebpackConfig ,
392+ incomingWebpackBuildContext : clientBuildContext ,
393+ } ) ;
394+
395+ expect ( finalServerWebpackConfig . entry ) . toEqual (
396+ expect . objectContaining ( {
397+ 'pages/_error' : expect . arrayContaining ( [ serverConfigFilePath ] ) ,
398+ } ) ,
399+ ) ;
400+ expect ( finalClientWebpackConfig . entry ) . toEqual (
401+ expect . objectContaining ( {
402+ 'pages/_error' : expect . not . arrayContaining ( [ clientConfigFilePath ] ) ,
403+ } ) ,
404+ ) ;
405+ } ) ;
406+
383407 it ( 'injects user config file into API routes' , async ( ) => {
384408 const finalWebpackConfig = await materializeFinalWebpackConfig ( {
385409 userNextConfig,
You can’t perform that action at this time.
0 commit comments