forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
47 lines (38 loc) · 1.33 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
afterEach(() => {
jest.resetModules();
});
describe('config', () => {
it('bilibilib cookie', () => {
process.env.BILIBILI_COOKIE_12 = 'cookie1';
process.env.BILIBILI_COOKIE_34 = 'cookie2';
const config = require('../lib/config').value;
expect(config.bilibili.cookies).toMatchObject({
12: 'cookie1',
34: 'cookie2',
});
delete process.env.BILIBILI_COOKIE_12;
delete process.env.BILIBILI_COOKIE_34;
});
it('twitter token', () => {
process.env.TWITTER_TOKEN_12 = 'token1';
process.env.TWITTER_TOKEN_34 = 'token2';
const config = require('../lib/config').value;
expect(config.twitter.tokens).toMatchObject({
12: 'token1',
34: 'token2',
});
delete process.env.TWITTER_TOKEN_12;
delete process.env.TWITTER_TOKEN_34;
});
it('email config', () => {
process.env['EMAIL_CONFIG_xx.qq.com'] = 'token1';
process.env['EMAIL_CONFIG_oo.qq.com'] = 'token2';
const config = require('../lib/config').value;
expect(config.email.config).toMatchObject({
'xx.qq.com': 'token1',
'oo.qq.com': 'token2',
});
delete process.env['EMAIL_CONFIG_xx.qq.com'];
delete process.env['EMAIL_CONFIG_oo.qq.com'];
});
});