-
Notifications
You must be signed in to change notification settings - Fork 20
/
parsed-config.ts
35 lines (29 loc) · 880 Bytes
/
parsed-config.ts
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
import { ParsedConfig } from './config.interface';
import { env } from './environments';
import { user } from './personas';
import * as minimist from 'minimist';
const args = minimist(process.argv.slice(2));
// get the options --env=xxx --user=yyy from the command line
const config: ParsedConfig = {
env: env(args.env),
user: user(args.user),
};
// get the option --testSpeed=xxx from the command line
if (args && args.testSpeed) {
config.testSpeed = Number(args.testSpeed);
}
config.timeout = {};
// get the option --longTimeout=xxx from the command line
if (args && args.longTimeout) {
config.timeout = {
longTimeout: args.longTimeout,
};
}
// get the option --shortTimeout=xxx from the command line
if (args && args.shortTimeout) {
config.timeout = {
...config.timeout,
shortTimeout: args.shortTimeout,
};
}
export const parsedConfig = config;