From 148505b38b883983b2f39c5f1e7ceb2e874285e9 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Sat, 27 Apr 2024 00:37:08 -0400 Subject: [PATCH] tests --- src/apphosting/index.ts | 5 ++++- src/test/apphosting/index.spec.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/apphosting/index.ts b/src/apphosting/index.ts index faba4ab5181..231a42db85d 100644 --- a/src/apphosting/index.ts +++ b/src/apphosting/index.ts @@ -408,7 +408,10 @@ export async function deleteBackendAndPoll( /** * Prompts the user for a location. */ -export async function promptLocation(projectId: string, prompt: string): Promise { +export async function promptLocation( + projectId: string, + prompt: string = "Please select a location:", +): Promise { const allowedLocations = (await apphosting.listLocations(projectId)).map((loc) => loc.locationId); return (await promptOnce({ diff --git a/src/test/apphosting/index.spec.ts b/src/test/apphosting/index.spec.ts index 2308859549a..8085396d60e 100644 --- a/src/test/apphosting/index.spec.ts +++ b/src/test/apphosting/index.spec.ts @@ -302,7 +302,11 @@ describe("apphosting setup functions", () => { promptOnceStub.resolves(location); await expect( - getBackendForAmbiguousLocation(projectId, "foo", /* prompt= */ ""), + getBackendForAmbiguousLocation( + projectId, + "foo", + /* prompt= */ "Please select the location of the backend you'd like to delete:", + ), ).to.eventually.equal(backendFoo); expect(promptOnceStub).to.be.calledWith({