@@ -10,13 +10,22 @@ import webpack from 'webpack';
10
10
11
11
import createServerConfig from '../server' ;
12
12
import { loadSetup } from '../../server/__tests__/testUtils' ;
13
+ import { createConfigureWebpackUtils } from '../configure' ;
14
+ import { DEFAULT_FUTURE_CONFIG } from '../../server/configValidation' ;
15
+
16
+ function createTestConfigureWebpackUtils ( ) {
17
+ return createConfigureWebpackUtils ( {
18
+ siteConfig : { webpack : { jsLoader : 'babel' } , future : DEFAULT_FUTURE_CONFIG } ,
19
+ } ) ;
20
+ }
13
21
14
22
describe ( 'webpack production config' , ( ) => {
15
23
it ( 'simple' , async ( ) => {
16
24
jest . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } ) ;
17
25
const { props} = await loadSetup ( 'simple-site' ) ;
18
26
const { config} = await createServerConfig ( {
19
27
props,
28
+ configureWebpackUtils : await createTestConfigureWebpackUtils ( ) ,
20
29
} ) ;
21
30
webpack . validate ( config ) ;
22
31
} ) ;
@@ -26,6 +35,7 @@ describe('webpack production config', () => {
26
35
const { props} = await loadSetup ( 'custom-site' ) ;
27
36
const { config} = await createServerConfig ( {
28
37
props,
38
+ configureWebpackUtils : await createTestConfigureWebpackUtils ( ) ,
29
39
} ) ;
30
40
webpack . validate ( config ) ;
31
41
} ) ;
0 commit comments