From ebc083b01a03183878c04b8e20c00a206e24a348 Mon Sep 17 00:00:00 2001 From: Zane Whitfield Date: Thu, 25 Apr 2024 15:55:05 -0700 Subject: [PATCH] WIP test --- packages/cli/src/commands/auth/token.ts | 2 +- packages/cli/test/unit/commands/auth/token.unit.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/auth/token.ts b/packages/cli/src/commands/auth/token.ts index f4a4a8b6ea..9bc2b464f7 100644 --- a/packages/cli/src/commands/auth/token.ts +++ b/packages/cli/src/commands/auth/token.ts @@ -22,7 +22,7 @@ By default, the CLI auth token is only valid for 1 year. To generate a long-live if (token && token.access_token.expires_in) { const d = new Date() d.setSeconds(d.getSeconds() + token.access_token.expires_in) - this.warn(`token will expire ${formatRelative(d, new Date())}\n${isInternal ? 'All tokens expire one year after we generate it.' : `To generate a token that expires in one year, use ${color.cmd('heroku authorizations:create')}.`}`) + this.warn(`token will expire ${formatRelative(d, new Date())}\n${isInternal ? 'All tokens expire one year after we generate it.' : `To generate, use ${color.cmd('heroku authorizations:create')}.`}`) } } catch (error: any) { this.warn(error) diff --git a/packages/cli/test/unit/commands/auth/token.unit.test.ts b/packages/cli/test/unit/commands/auth/token.unit.test.ts index beea4c7234..79083dea01 100644 --- a/packages/cli/test/unit/commands/auth/token.unit.test.ts +++ b/packages/cli/test/unit/commands/auth/token.unit.test.ts @@ -1,4 +1,5 @@ import {expect, test} from '@oclif/test' +// import stripAnsi from 'strip-ansi' describe('auth:token', () => { test @@ -34,7 +35,7 @@ describe('auth:token', () => { .command(['auth:token']) .it('shows "long-term" token generation warning for non-internal users', ctx => { expect(ctx.stdout).to.equal('foobar\n') - expect(ctx.stderr).to.contain('To generate a token that expires in one year, use heroku authorizations:create.') + expect(ctx.stderr).to.contain('To generate, use heroku authorizations:create.') expect(ctx.stderr).to.not.contain('All tokens expire one year after we generate it.') })