@@ -70,13 +70,34 @@ describe('normalizeConfig', () => {
7070 expect ( normalized . output ?. publicPath ) . toBe ( 'noop:///' ) ;
7171 } ) ;
7272
73+ it ( 'should set publicPath to devServer public path if it uses DEV_SERVER_PUBLIC_PATH' , ( ) => {
74+ const config = {
75+ devServer : { host : 'example.com' , port : 3000 } ,
76+ output : { publicPath : 'DEV_SERVER_PUBLIC_PATH' } ,
77+ } as ConfigurationObject ;
78+ const normalized = normalizeConfig ( config , 'ios' ) ;
79+ expect ( normalized . output ?. publicPath ) . toBe (
80+ 'http://example.com:3000/ios/'
81+ ) ;
82+ } ) ;
83+
7384 it ( 'should keep custom publicPath unchanged' , ( ) => {
7485 const config = {
7586 output : { publicPath : 'http://localhost:8081' } ,
7687 } as ConfigurationObject ;
7788 const normalized = normalizeConfig ( config , 'ios' ) ;
7889 expect ( normalized . output ?. publicPath ) . toBe ( 'http://localhost:8081' ) ;
7990 } ) ;
91+
92+ it ( 'should replace [platform] placeholders' , ( ) => {
93+ const config = {
94+ output : { publicPath : 'http://example.com:3000/[platform]/' } ,
95+ } as ConfigurationObject ;
96+ const normalized = normalizeConfig ( config , 'ios' ) ;
97+ expect ( normalized . output ?. publicPath ) . toBe (
98+ 'http://example.com:3000/ios/'
99+ ) ;
100+ } ) ;
80101 } ) ;
81102
82103 describe ( 'resolve.extensions normalization' , ( ) => {
0 commit comments