Skip to content

Commit

Permalink
Fix shared tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eablack committed Mar 5, 2024
1 parent e5d6276 commit f9ef026
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/cli/test/unit/commands/certs/info.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ describe('heroku shared', function () {

const stdout = function (certificateDetails: string) {
return heredoc(`
Certificate details:
${certificateDetails}
Certificate details:
${certificateDetails}
`)
}

Expand Down
10 changes: 4 additions & 6 deletions packages/cli/test/unit/commands/certs/shared_sni.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const shouldHandleArgs = function (commandText: string, command: GenericC
'tokyo-1050',
])
expectOutput(stderr.output, stderrOutput(endpoint))
expectOutput(stdout.output, stdoutOutput(certificateDetails, endpoint))
expectOutput(stdout.output, stdoutOutput(certificateDetails(), endpoint))
})

it('# errors out for --endpoint when there are multiple ', async function () {
Expand All @@ -51,8 +51,6 @@ export const shouldHandleArgs = function (commandText: string, command: GenericC
'example',
'--endpoint',
'tokyo-1050.herokussl.com',
'--confirm',
'example',
]).catch(function (error: Error) {
expect(error.message).to.equal('Must pass --name when more than one endpoint matches --endpoint')
})
Expand All @@ -70,7 +68,7 @@ export const shouldHandleArgs = function (commandText: string, command: GenericC
'tokyo-1050.herokussl.com',
])
expectOutput(stderr.output, stderrOutput(endpoint))
expectOutput(stdout.output, stdoutOutput(certificateDetails, endpoint))
expectOutput(stdout.output, stdoutOutput(certificateDetails(), endpoint))
})

it('# --endpoint errors out if there is no match', async function () {
Expand All @@ -80,6 +78,8 @@ export const shouldHandleArgs = function (commandText: string, command: GenericC
await runCommand(command, [
'--app',
'example',
'--endpoint',
'tokyo-1050.herokussl.com',
]).catch(function (error: Error) {
expect(error.message).to.equal('Record not found.')
})
Expand All @@ -94,8 +94,6 @@ export const shouldHandleArgs = function (commandText: string, command: GenericC
'example',
'--name',
'tokyo-1050',
'--confirm',
'example',
]).catch(function (error: Error) {
expect(error.message).to.equal('More than one endpoint matches tokyo-1050, please file a support ticket')
})
Expand Down

0 comments on commit f9ef026

Please sign in to comment.