Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyjhuang committed Apr 27, 2024
1 parent 95d459c commit 148505b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/apphosting/index.ts
Expand Up @@ -408,7 +408,10 @@ export async function deleteBackendAndPoll(
/**
* Prompts the user for a location.
*/
export async function promptLocation(projectId: string, prompt: string): Promise<string> {
export async function promptLocation(
projectId: string,
prompt: string = "Please select a location:",

Check warning on line 413 in src/apphosting/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Type string trivially inferred from a string literal, remove type annotation
): Promise<string> {
const allowedLocations = (await apphosting.listLocations(projectId)).map((loc) => loc.locationId);

return (await promptOnce({
Expand Down
6 changes: 5 additions & 1 deletion src/test/apphosting/index.spec.ts
Expand Up @@ -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({
Expand Down

0 comments on commit 148505b

Please sign in to comment.