@@ -4446,6 +4446,47 @@ addEventListener('fetch', event => {});`
44464446 ` ) ;
44474447 } ) ;
44484448
4449+ it ( "should warn when using smart placement with Worker first" , async ( ) => {
4450+ const assets = [
4451+ { filePath : ".assetsignore" , content : "*.bak\nsub-dir" } ,
4452+ { filePath : "file-1.txt" , content : "Content of file-1" } ,
4453+ { filePath : "file-2.bak" , content : "Content of file-2" } ,
4454+ { filePath : "file-3.txt" , content : "Content of file-3" } ,
4455+ { filePath : "sub-dir/file-4.bak" , content : "Content of file-4" } ,
4456+ { filePath : "sub-dir/file-5.txt" , content : "Content of file-5" } ,
4457+ ] ;
4458+ writeAssets ( assets , "assets" ) ;
4459+ writeWranglerConfig ( {
4460+ assets : {
4461+ directory : "assets" ,
4462+ experimental_serve_directly : false ,
4463+ } ,
4464+ placement : {
4465+ mode : "smart" ,
4466+ } ,
4467+ } ) ;
4468+ const bodies : AssetManifest [ ] = [ ] ;
4469+ await mockAUSRequest ( bodies ) ;
4470+ mockSubDomainRequest ( ) ;
4471+ mockUploadWorkerRequest ( {
4472+ expectedAssets : {
4473+ jwt : "<<aus-completion-token>>" ,
4474+ config : {
4475+ serve_directly : true ,
4476+ } ,
4477+ } ,
4478+ expectedType : "none" ,
4479+ } ) ;
4480+
4481+ await runWrangler ( "deploy" ) ;
4482+
4483+ expect ( std . warn ) . toMatchInlineSnapshot ( `
4484+ "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mUsing assets with smart placement enabled may result in poor performance.[0m
4485+
4486+ "
4487+ ` ) ;
4488+ } ) ;
4489+
44494490 it ( "should warn if experimental_serve_directly=false but no binding is provided" , async ( ) => {
44504491 const assets = [
44514492 { filePath : ".assetsignore" , content : "*.bak\nsub-dir" } ,
0 commit comments