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