Skip to content

Commit

Permalink
More validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 16, 2022
1 parent 1e0b357 commit e38d8f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/config/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ const NORMALIZERS = {
colors: [checkBoolean],
cwd: [checkString, checkDefinedString],
delta: [normalizeDelta],
force: [checkBoolean],
inputs: [checkObjectProps.bind(undefined, [checkJson])],
limit: [checkInteger, normalizeLimit],
merge: [validateMerge],
outliers: [checkBoolean],
precision: [checkInteger, normalizePrecision],
quiet: [checkBoolean],
reporter: [
normalizeOptionalArray,
checkArrayItems.bind(undefined, [checkString, checkDefinedString]),
Expand All @@ -88,7 +90,9 @@ const NORMALIZERS = {
checkArrayItems.bind(undefined, [checkString]),
],
showDiff: [checkBoolean],
showMetadata: [checkBoolean],
showPrecision: [checkBoolean],
showSystem: [checkBoolean],
showTitles: [checkBoolean],
since: [normalizeDelta],
system: [checkObjectProps.bind(undefined, [checkString])],
Expand Down
8 changes: 0 additions & 8 deletions src/config/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,16 @@ const optionalConfigSelectors = function (valueA, valueB) {

const EXAMPLE_CONFIG = {
...DEFAULT_CONFIG,
force: true,
inputs: { inputId: 'inputValue' },
limit: optionalConfigSelectors(3, 10),
merge: 'f0f13513-5267-43a9-a02a-60fdde0332d0',
outliers: optionalConfigSelectors(true, false),
output: './file.js',
precision: optionalConfigSelectors(3, 10),
quiet: true,
reporter: optionalArray('debug'),
reporterConfig: { debug: { property: true } },
runner: optionalArray('node'),
runnerConfig: { node: { version: '8' } },
select: optionalArray('task_id'),
showDiff: optionalConfigSelectors(true, false),
showMetadata: true,
showPrecision: optionalConfigSelectors(true, false),
showSystem: true,
showTitles: optionalConfigSelectors(true, false),
system: { os: 'linux', node_version: 'node_8' },
tasks: optionalArray('./benchmark/tasks.js'),
titles: { taskId: 'taskTitle' },
Expand Down

0 comments on commit e38d8f7

Please sign in to comment.