@@ -6889,6 +6889,60 @@ addEventListener('fetch', event => {});`
68896889 expect ( std . err ) . toMatchInlineSnapshot ( `""` ) ;
68906890 expect ( std . warn ) . toMatchInlineSnapshot ( `""` ) ;
68916891 } ) ;
6892+
6893+ it ( "should warn the user if workers_dev default is different from remote" , async ( ) => {
6894+ writeWranglerConfig ( { } ) ; // Default workers_dev should be true, since there's no routes.
6895+ writeWorkerSource ( ) ;
6896+ mockSubDomainRequest ( ) ;
6897+ mockUploadWorkerRequest ( ) ;
6898+ mockGetWorkerSubdomain ( { enabled : false } ) ;
6899+ mockUpdateWorkerSubdomain ( { enabled : true } ) ;
6900+ await runWrangler ( "deploy ./index" ) ;
6901+
6902+ expect ( std . out ) . toMatchInlineSnapshot ( `
6903+ "Total Upload: xx KiB / gzip: xx KiB
6904+ Worker Startup Time: 100 ms
6905+ Uploaded test-name (TIMINGS)
6906+ Deployed test-name triggers (TIMINGS)
6907+ https://test-name.test-sub-domain.workers.dev
6908+ Current Version ID: Galaxy-Class"
6909+ ` ) ;
6910+ expect ( std . err ) . toMatchInlineSnapshot ( `""` ) ;
6911+ expect ( std . warn ) . toMatchInlineSnapshot ( `
6912+ "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWorker has workers.dev disabled, but 'workers_dev' is not in the config.[0m
6913+
6914+ Using fallback value 'workers_dev = true'.
6915+
6916+ "
6917+ ` ) ;
6918+ } ) ;
6919+
6920+ it ( "should warn the user if preview_urls default is different from remote" , async ( ) => {
6921+ writeWranglerConfig ( { } ) ; // Default preview_urls should be false.
6922+ writeWorkerSource ( ) ;
6923+ mockSubDomainRequest ( ) ;
6924+ mockUploadWorkerRequest ( ) ;
6925+ mockGetWorkerSubdomain ( { enabled : true , previews_enabled : true } ) ;
6926+ mockUpdateWorkerSubdomain ( { enabled : true , previews_enabled : false } ) ;
6927+ await runWrangler ( "deploy ./index" ) ;
6928+
6929+ expect ( std . out ) . toMatchInlineSnapshot ( `
6930+ "Total Upload: xx KiB / gzip: xx KiB
6931+ Worker Startup Time: 100 ms
6932+ Uploaded test-name (TIMINGS)
6933+ Deployed test-name triggers (TIMINGS)
6934+ https://test-name.test-sub-domain.workers.dev
6935+ Current Version ID: Galaxy-Class"
6936+ ` ) ;
6937+ expect ( std . err ) . toMatchInlineSnapshot ( `""` ) ;
6938+ expect ( std . warn ) . toMatchInlineSnapshot ( `
6939+ "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mWorker has preview URLs enabled, but 'preview_urls' is not in the config.[0m
6940+
6941+ Using fallback value 'preview_urls = false'.
6942+
6943+ "
6944+ ` ) ;
6945+ } ) ;
68926946 } ) ;
68936947
68946948 describe ( "[define]" , ( ) => {
0 commit comments