Skip to content

Commit

Permalink
refactor: replace param in test helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
k80bowman committed Mar 12, 2024
1 parent a30c220 commit 1f1b6b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/test/helpers/stubs/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function collaborators() {
}).reply(200)
}

export function teamAppCollaborators(email = 'raulb@heroku.com', permissions: string[] = []) {
export function teamAppCollaborators(email = 'raulb@heroku.com', permissions: string[] = [], response: {code?: number, description?: Record<string, unknown>} = {}) {
const body: {user: string, permissions?: string[]} = {user: email}
if (permissions.length > 0) {
body.permissions = permissions
Expand All @@ -16,7 +16,7 @@ export function teamAppCollaborators(email = 'raulb@heroku.com', permissions: st
return nock('https://api.heroku.com:443', {
reqheaders: {Accept: 'application/vnd.heroku+json; version=3'},
})
.post('/teams/apps/myapp/collaborators', body).reply(200)
.post('/teams/apps/myapp/collaborators', body).reply(response.code || 200, response.description)
}

export function personalToPersonal() {
Expand Down

0 comments on commit 1f1b6b1

Please sign in to comment.