From 071f0796f315d71d517ca7c661292c2f12dc70bc Mon Sep 17 00:00:00 2001 From: Justin Wilaby Date: Mon, 29 Apr 2024 12:15:27 -0700 Subject: [PATCH] Updated help and unit tests --- packages/cli/src/commands/spaces/transfer.ts | 9 +++++++-- packages/cli/test/unit/commands/transfer.unit.test.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/spaces/transfer.ts b/packages/cli/src/commands/spaces/transfer.ts index 1cf18067e6..a29e842e28 100644 --- a/packages/cli/src/commands/spaces/transfer.ts +++ b/packages/cli/src/commands/spaces/transfer.ts @@ -1,11 +1,16 @@ import color from '@heroku-cli/color' import {Command, flags} from '@heroku-cli/command' import {ux} from '@oclif/core' +import heredoc from 'tsheredoc'; export default class Transfer extends Command { static topic = 'spaces'; - static description = 'transfer a space to another team'; - static help = 'Example:\n\n $ heroku spaces:transfer --space=space-name --team=team-name\n Transferring space-name to team-name... done\n'; + static description = 'transfer a space to another team' + static examples = [heredoc(` + $ heroku spaces:transfer --space=space-name --team=team-name + Transferring space-name to team-name... done + `)] + static flags = { space: flags.string({required: true, description: 'name of space'}), team: flags.string({required: true, description: 'desired owner of space'}), diff --git a/packages/cli/test/unit/commands/transfer.unit.test.ts b/packages/cli/test/unit/commands/transfer.unit.test.ts index 9e4ec0c6e0..9b41e56a06 100644 --- a/packages/cli/test/unit/commands/transfer.unit.test.ts +++ b/packages/cli/test/unit/commands/transfer.unit.test.ts @@ -42,8 +42,8 @@ describe('spaces:transfer', function () { space, ]) } catch (error) { - const {message} = error as {message: string} - expect(message).to.eq(message) + const {message: errorMessage} = error as {message: string} + expect(errorMessage).to.eq(message) } api.done()