Skip to content

Commit

Permalink
Fix options
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Aug 25, 2019
1 parent f64fa96 commit 39e2cbd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
4 changes: 2 additions & 2 deletions src/options/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const getConfigPath = async function(config, { cwd = getCwd() }) {
return resolve(cwd, config)
}

const configFile = await findUp(DEFAULT_CONFIG_FILES, { cwd })
const configFile = await findUp(DEFAULT_CONFIG, { cwd })
return configFile
}

const DEFAULT_CONFIG_FILES = ['spyd.yml', 'spyd.yaml']
const DEFAULT_CONFIG = ['spyd.yml', 'spyd.yaml']

const getConfigContent = async function(configPath) {
try {
Expand Down
27 changes: 13 additions & 14 deletions src/options/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,25 @@ const TYPES = {

const OPTS = {
colors: 'boolean',
diff: 'boolean',
link: 'boolean',
remove: 'boolean',
save: 'boolean',
show: 'boolean',
info: 'boolean',
context: 'boolean',
config: 'string',
context: 'boolean',
cwd: 'string',
data: 'string',
system: 'string',
insert: 'string',
group: 'string',
output: 'string',
delta: 'string',
diff: 'boolean',
duration: 'number',
files: 'stringArray',
tasks: 'stringArray',
variations: 'stringArray',
group: 'string',
info: 'boolean',
insert: 'string',
limit: 'stringArray',
link: 'boolean',
output: 'string',
progress: 'object',
report: 'object',
run: 'object',
save: 'boolean',
store: 'object',
system: 'string',
tasks: 'stringArray',
variations: 'stringArray',
}
34 changes: 17 additions & 17 deletions src/options/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ const getRunners = function({ run }) {
}

const DEFAULT_OPTS = {
files: ['benchmarks.*', 'benchmarks/main.*'],
colors: isInteractive(stderr),
cwd: getCwd(),
delta: true,
diff: true,
duration: 10,
colors: isInteractive(stderr),
system: '',
link: true,
files: ['benchmarks.*', 'benchmarks/main.*'],
info: false,
save: false,
run: { node: {} },
report: { debug: {} },
limit: [],
link: true,
progress: { debug: {} },
report: { debug: {} },
run: { node: {} },
save: false,
store: { file: {} },
limit: [],
delta: true,
diff: true,
system: '',
}

const VALID_TIMESTAMPS = [
Expand All @@ -89,14 +89,14 @@ const VALID_BENCHMARK_DELTA = multipleValidOptions(true, 3, ...VALID_TIMESTAMPS)
const EXAMPLE_OPTS = {
...DEFAULT_OPTS,
config: 'spyd.yml',
tasks: ['taskId'],
variations: ['variationId'],
group: multipleValidOptions('', '546'),
system: 'Windows 10',
output: './file.js',
insert: './README.md',
context: true,
limit: ['taskId=10'],
delta: VALID_BENCHMARK_DELTA,
diff: VALID_BENCHMARK_DELTA,
group: multipleValidOptions('', '546'),
insert: './README.md',
limit: ['taskId=10'],
output: './file.js',
system: 'Windows 10',
tasks: ['taskId'],
variations: ['variationId'],
}

0 comments on commit 39e2cbd

Please sign in to comment.