@@ -57,20 +57,16 @@ describe("ConfigController", () => {
5757 ` ,
5858 } ) ;
5959 await runWrangler ( "types" ) ;
60-
61- const event = waitForConfigUpdate ( controller ) ;
6260 await controller . set ( { config : "./wrangler.toml" } ) ;
63- await event ;
6461
65- const event2 = waitForConfigUpdate ( controller ) ;
6662 await seed ( {
6763 "wrangler.toml" : dedent /* toml */ `
6864 name = "my-worker"
6965 main = "src/index.ts"
7066 compatibility_date = \"2025-06-01\"
7167 ` ,
7268 } ) ;
73- await event2 ;
69+ await controller . set ( { config : "./wrangler.toml" } ) ;
7470
7571 await vi . waitFor ( ( ) => {
7672 expect ( std . out ) . toContain ( "Your types might be out of date." ) ;
@@ -89,16 +85,14 @@ describe("ConfigController", () => {
8985 ` ,
9086 } ) ;
9187
92- const event = waitForConfigUpdate ( controller ) ;
9388 await controller . set ( { config : "./wrangler.toml" } ) ;
94-
95- const { config } = await event ;
96- await expect ( unwrapHook ( config . dev . auth ) ) . resolves . toMatchObject ( {
89+ await expect (
90+ unwrapHook ( controller . latestConfig ?. dev . auth )
91+ ) . resolves . toMatchObject ( {
9792 accountId : "some-account-id" ,
9893 apiToken : { apiToken : "some-api-token" } ,
9994 } ) ;
10095
101- const event2 = waitForConfigUpdate ( controller ) ;
10296 await seed ( {
10397 "wrangler.toml" : dedent /* toml */ `
10498 name = "my-worker"
@@ -107,9 +101,10 @@ describe("ConfigController", () => {
107101 account_id = "1234567890"
108102 ` ,
109103 } ) ;
110-
111- const { config : config2 } = await event2 ;
112- await expect ( unwrapHook ( config2 . dev . auth ) ) . resolves . toMatchObject ( {
104+ await controller . set ( { config : "./wrangler.toml" } ) ;
105+ await expect (
106+ unwrapHook ( controller . latestConfig ?. dev . auth )
107+ ) . resolves . toMatchObject ( {
113108 accountId : "1234567890" ,
114109 apiToken : { apiToken : "some-api-token" } ,
115110 } ) ;
0 commit comments