Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit 72d68a3

Browse files
committed
Fixes tests for templates
1 parent 8db50ad commit 72d68a3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/commands/list-templates.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ const listTemplates = async function() {
1717
)
1818
);
1919
} catch (err) {
20+
console.error(err);
2021
spinner.fail('Could not retrieve templates');
21-
process.exit(1);
22+
process.exitCode = 1;
2223
return;
2324
}
2425
};

tests/list-templates.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ jest.mock('ora');
66
ora.mockImplementation(() => {
77
const spinner = {
88
start: () => spinner,
9-
stop: () => spinner
9+
stop: () => spinner,
10+
fail: () => spinner
1011
};
1112
return spinner;
1213
});
@@ -34,7 +35,7 @@ describe('listTemplates', () => {
3435
description: 'A template to test with'
3536
};
3637
nock('https://raw.githubusercontent.com')
37-
.get('/twilio-labs/function-templates/master/templates.json')
38+
.get('/twilio-labs/function-templates/next/templates.json')
3839
.reply(200, {
3940
templates: [template]
4041
});

0 commit comments

Comments
 (0)