Skip to content

Commit 603c0ce

Browse files
committed
Add test for a error condition
1 parent 97e7843 commit 603c0ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/config.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ describe('config:', () => {
3939
process.env.DB_PASSWORD = '';
4040
process.env.DB_NAME = '';
4141
});
42+
43+
it('should throw an error if the required env vars are not provided.', () => {
44+
expect(() => resolveConnectionsFromEnv()).to.throw(
45+
'Following environment variables were not set: DB_HOST, DB_PASSWORD, DB_NAME, DB_USERNAME, DB_PORT, DB_CLIENT'
46+
);
47+
});
4248
});
4349

4450
describe('validate', () => {

0 commit comments

Comments
 (0)