Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/commands/apps/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ async function checksum(heroku: APIClient, app: string): Promise<string | null>
}

async function diffFiles(heroku: APIClient, app1: string, app2: string): Promise<DiffRow[]> {
const sums = await Promise.all([checksum(heroku, app1), checksum(heroku, app2)])
return sums[0] === sums[1] ? [] : [{prop: 'slug (checksum)', app1: sums[0] ?? undefined, app2: sums[1] ?? undefined}]
const sum1 = await checksum(heroku, app1)
const sum2 = await checksum(heroku, app2)
return sum1 === sum2 ? [] : [{prop: 'slug (checksum)', app1: sum1 ?? undefined, app2: sum2 ?? undefined}]
}

async function diffEnv(heroku: APIClient, app1: string, app2: string): Promise<DiffRow[]> {
Expand Down
4 changes: 0 additions & 4 deletions test/unit/commands/apps/diff.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ describe('apps:diff', function () {
it('throws App not found when one app returns 404 on releases', async function () {
api
.get(`/apps/${app1Name}/releases`).matchHeader('range', /version/).reply(404, {id: 'not_found', message: 'Couldn\'t find that app.'})
.get(`/apps/${app2Name}/releases`).matchHeader('range', /version/).reply(200, releasesWithSlug(slugId2))
.get(`/apps/${app2Name}/slugs/${slugId2}`).optionally().reply(200, slugBody(sameChecksum))

const {error} = await runCommand(AppsDiff, [app1Name, app2Name])

Expand All @@ -146,8 +144,6 @@ describe('apps:diff', function () {
api
.get(`/apps/${app1Name}/releases`).matchHeader('range', /version/).reply(200, releasesWithSlug(slugId1))
.get(`/apps/${app1Name}/slugs/${slugId1}`).reply(404, {id: 'not_found', message: 'Not found'})
.get(`/apps/${app2Name}/releases`).matchHeader('range', /version/).reply(200, releasesWithSlug(slugId2))
.get(`/apps/${app2Name}/slugs/${slugId2}`).reply(200, slugBody(sameChecksum))

const {error} = await runCommand(AppsDiff, [app1Name, app2Name])

Expand Down
Loading