Skip to content

Commit 1614dbb

Browse files
committed
fix(test-utils): Fix TypeScript error by capturing resolvedPort for closure
1 parent 76980e2 commit 1614dbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dev-packages/test-utils/src/spotlight.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ export async function startSpotlight(options: SpotlightOptions = {}): Promise<Sp
175175
// When Spotlight says it's listening, start waiting for the app
176176
if (!resolved && resolvedPort && line.includes('listening')) {
177177
resolved = true;
178+
const spotlightPort = resolvedPort; // Capture for closure
178179
// Wait for app to be ready before resolving
179180
waitForAppReady()
180181
.then(() => {
181-
const instance = createSpotlightInstance(spotlightProcess, resolvedPort, debug);
182+
const instance = createSpotlightInstance(spotlightProcess, spotlightPort, debug);
182183
currentSpotlightInstance = instance;
183184
resolve(instance);
184185
})

0 commit comments

Comments
 (0)