Skip to content

Commit 1b1250c

Browse files
michaelmalavetlowrimore-heroku
authored andcommitted
fix: stabilize apps:diff 404 tests by mocking both apps (#3585)
1 parent 407ed21 commit 1b1250c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/unit/commands/apps/diff.unit.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ describe('apps:diff', function () {
132132
it('throws App not found when one app returns 404 on releases', async function () {
133133
api
134134
.get(`/apps/${app1Name}/releases`).matchHeader('range', /version/).reply(404, {id: 'not_found', message: 'Couldn\'t find that app.'})
135+
.get(`/apps/${app2Name}/releases`).matchHeader('range', /version/).reply(200, releasesWithSlug(slugId2))
136+
.get(`/apps/${app2Name}/slugs/${slugId2}`).reply(200, slugBody(sameChecksum))
135137

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

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

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

0 commit comments

Comments
 (0)