Skip to content

Commit ff34567

Browse files
maxbeattymathiasbynens
authored andcommitted
set env var defaults
1 parent 8fa1c45 commit ff34567

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

test/unit/config.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@ const Lab = require('lab');
22
const Code = require('code');
33
const Proxyquire = require('proxyquire').noPreserveCache();
44

5-
const Config = require('../../config');
5+
const Config = Proxyquire('../../config', {
6+
'dotenv': {
7+
config: () => {
8+
// set environment variables that should be in .env file
9+
[
10+
'GITHUB_CLIENT_SECRET',
11+
'GITHUB_CLIENT_ID',
12+
'GITHUB_CALLBACK',
13+
'BELL_COOKIE_PASS',
14+
'COOKIE_PASS',
15+
'BROWSERSCOPE',
16+
'MYSQL_USER',
17+
'MYSQL_PASSWORD',
18+
'MYSQL_DATABASE'
19+
].map((k) => {
20+
process.env[k] = k;
21+
});
22+
}
23+
}
24+
});
625

726
const lab = exports.lab = Lab.script();
827

0 commit comments

Comments
 (0)