Skip to content

Commit 50f9ba2

Browse files
author
Tim Mendoza
committed
Add tests for new error
1 parent 6af9c6e commit 50f9ba2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/helpers/helpers.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,29 @@ describe('the deploy function', () => {
265265
expect(mockDeployProject.mock.calls[0][0].serviceSid).toBe(undefined);
266266
expect(mockDeployProject.mock.calls[0][0].serviceName).toBe(APP_NAME);
267267
});
268+
269+
it('display an error when the and API key is not provided', () => {
270+
return expect(
271+
deploy.call({
272+
twilioClient: {
273+
username: 'testAccountSid',
274+
password: 'testAuthToken',
275+
accountSid: 'testAccountSid',
276+
},
277+
flags: {},
278+
})
279+
).rejects.toMatchInlineSnapshot(`
280+
[Error: No API Key found.
281+
282+
Please login to the Twilio CLI to create an API key:
283+
284+
twilio login
285+
286+
Alternatively, the Twilio CLI can use credentials stored in these environment variables:
287+
288+
TWILIO_ACCOUNT_SID = your Account SID from twil.io/console
289+
TWILIO_API_KEY = an API Key created at twil.io/get-api-key
290+
TWILIO_API_SECRET = the secret for the API Key]
291+
`);
292+
});
268293
});

0 commit comments

Comments
 (0)