11import { DurableObject } from "cloudflare:workers" ;
22
3- export class Container extends DurableObject < Env > {
3+ export class FixtureTestContainer extends DurableObject < Env > {
44 container : globalThis . Container ;
55 monitor ?: Promise < unknown > ;
66
77 constructor ( ctx : DurableObjectState , env : Env ) {
88 super ( ctx , env ) ;
9- this . container = ctx . container ! ;
9+ this . container = ctx . container ;
1010 }
1111
1212 async fetch ( req : Request ) {
@@ -25,7 +25,7 @@ export class Container extends DurableObject<Env> {
2525 case "/start" :
2626 this . container . start ( {
2727 entrypoint : [ "node" , "app.js" ] ,
28- env : { A : "B" , C : "D" , L : "F " } ,
28+ env : { MESSAGE : "I'm an env var! " } ,
2929 enableInternet : false ,
3030 } ) ;
3131 // this doesn't instantly start, so we will need to poll /fetch
@@ -39,9 +39,6 @@ export class Container extends DurableObject<Env> {
3939 return new Response ( await res . text ( ) ) ;
4040
4141 case "/destroy-with-monitor" :
42- // if (!this.container.running) {
43- // throw new Error("Container is not running.");
44- // }
4542 const monitor = this . container . monitor ( ) ;
4643 await this . container . destroy ( ) ;
4744 await monitor ;
0 commit comments