@@ -9155,6 +9155,56 @@ addEventListener('fetch', event => {});`
91559155 expect ( std . warn ) . toMatchInlineSnapshot ( `""` ) ;
91569156 } ) ;
91579157
9158+ it ( "should error when no scope for containers" , async ( ) => {
9159+ mockContainersAccount ( [ ] ) ;
9160+ writeWranglerConfig ( {
9161+ durable_objects : {
9162+ bindings : [
9163+ {
9164+ name : "EXAMPLE_DO_BINDING" ,
9165+ class_name : "ExampleDurableObject" ,
9166+ } ,
9167+ ] ,
9168+ } ,
9169+ containers : [
9170+ {
9171+ image : "docker.io/hello:world" ,
9172+ name : "my-container" ,
9173+ instances : 10 ,
9174+ class_name : "ExampleDurableObject" ,
9175+ } ,
9176+ ] ,
9177+ migrations : [
9178+ { tag : "v1" , new_sqlite_classes : [ "ExampleDurableObject" ] } ,
9179+ ] ,
9180+ } ) ;
9181+ fs . writeFileSync (
9182+ "index.js" ,
9183+ `export class ExampleDurableObject {}; export default{};`
9184+ ) ;
9185+ mockSubDomainRequest ( ) ;
9186+ mockLegacyScriptData ( {
9187+ scripts : [ { id : "test-name" , migration_tag : "v1" } ] ,
9188+ } ) ;
9189+ mockUploadWorkerRequest ( {
9190+ expectedBindings : [
9191+ {
9192+ class_name : "ExampleDurableObject" ,
9193+ name : "EXAMPLE_DO_BINDING" ,
9194+ type : "durable_object_namespace" ,
9195+ } ,
9196+ ] ,
9197+ useOldUploadApi : true ,
9198+ expectedContainers : [ { class_name : "ExampleDurableObject" } ] ,
9199+ } ) ;
9200+
9201+ await expect (
9202+ runWrangler ( "deploy index.js" )
9203+ ) . rejects . toThrowErrorMatchingInlineSnapshot (
9204+ `[Error: You need 'containers:write', try logging in again or creating an appropiate API token]`
9205+ ) ;
9206+ } ) ;
9207+
91589208 it ( "should support durable objects and D1" , async ( ) => {
91599209 writeWranglerConfig ( {
91609210 main : "index.js" ,
0 commit comments