You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4ae3e02
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: test/unit/commands/accounts/current.unit.test.ts
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,8 @@ describe('accounts:current', function () {
25
25
26
26
it('should print an error message if no account is found',asyncfunction(){
27
27
currentStub.resolves(null)
28
-
awaitrunCommand(Cmd,[])
29
-
.catch((error: Error)=>{
30
-
constexpected='You haven\'t set an account. Run heroku accounts:add <account-name> to add an account to your cache or heroku accounts:set <account-name> to set the current account.'
.reply(423,{id: 'confirmation_required',message: 'This add-on is not automatically networked with this Private Space. '},{'X-Confirmation-Required': 'myapp-confirm'})
307
303
308
-
returnrunCommand(Cmd,[
304
+
const{error}=awaitrunCommand(Cmd,[
309
305
'--app',
310
306
'myapp',
311
307
'--as',
@@ -319,9 +315,7 @@ describe('addons:create', function () {
319
315
'otherdb',
320
316
'--foo',
321
317
])
322
-
.catch(error=>{
323
-
expect(ansis.strip(error.message)).to.equal('Confirmation not-my-app did not match myapp. Aborted.')
324
-
})
318
+
expect(ansis.strip(error?.message??'')).to.equal('Confirmation not-my-app did not match myapp. Aborted.')
325
319
})
326
320
327
321
it('succeeds if confirmation does match',asyncfunction(){
.reply(422,{message: 'Couldn\'t find either the add-on service or the add-on plan of "heroku-db1:invalid".'})
171
166
172
-
try{
173
-
awaitrunCommand(Cmd,[
174
-
'--app',
175
-
'myapp',
176
-
'heroku-db1:invalid',
177
-
])
178
-
}catch(error){
179
-
if(errorinstanceofError){
180
-
expect(ansis.strip(error.message)).to.equal('Couldn\'t find either the add-on service or the add-on plan of "heroku-db1:invalid".\n\nHere are the available plans for heroku-db1:\nheroku-db1:free\nheroku-db1:basic\nheroku-db1:premium-0\n\nSee more plan information with heroku addons:plans heroku-db1\n\nhttps://devcenter.heroku.com/articles/managing-add-ons')
181
-
}
182
-
}
167
+
const{error}=awaitrunCommand(Cmd,[
168
+
'--app',
169
+
'myapp',
170
+
'heroku-db1:invalid',
171
+
])
172
+
expect(ansis.strip(error?.message??'')).to.equal('Couldn\'t find either the add-on service or the add-on plan of "heroku-db1:invalid".\n\nHere are the available plans for heroku-db1:\nheroku-db1:free\nheroku-db1:basic\nheroku-db1:premium-0\n\nSee more plan information with heroku addons:plans heroku-db1\n\nhttps://devcenter.heroku.com/articles/managing-add-ons')
183
173
})
184
174
185
175
it('displays an error when multiple matches exist',asyncfunction(){
0 commit comments