Skip to content

Commit

Permalink
Move reporter.format to reporter.config.format
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 30, 2022
1 parent 1474470 commit 4566303
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/report/config/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const addOutput = function (reporter) {
const output = getOutput(reporter)
const format = detectFormat(reporter, output)
const tty = getTty(output)
return { ...reporter, config: { ...reporter.config, output }, format, tty }
return { ...reporter, config: { ...reporter.config, output, format }, tty }
}

// The reporter's output is decided by (in priority order):
Expand Down
4 changes: 2 additions & 2 deletions src/report/config/programmatic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export const addProgrammaticReporter = function (reporters) {

const PROGRAMMATIC_REPORTER = {
id: 'programmatic',
format: 'programmatic',
capabilities: {
debugStats: false,
history: true,
},
tty: false,
config: {
quiet: true,
format: 'programmatic',
output: '',
quiet: true,
showSystem: true,
showMetadata: true,
showTitles: true,
Expand Down
2 changes: 1 addition & 1 deletion src/report/config/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const validateConcatGroup = function (output, reporters) {
)
}

const reporterCannotConcat = function ({ format }) {
const reporterCannotConcat = function ({ config: { format } }) {
return !FORMATS[format].concat
}

Expand Down
4 changes: 2 additions & 2 deletions src/report/contents/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ const callReportFunc = async function ({
reporter,
reporter: {
result,
format,
footerString,
startData,
config: reporterConfig,
config: { output, colors },
config: { format, output, colors },
},
}) {
const reporterSpecificConfig = omit.default(
Expand All @@ -40,6 +39,7 @@ const callReportFunc = async function ({

// We only pass reporter-specific properties, not core ones
const CORE_REPORTER_PROPS = [
'format',
'output',
'colors',
'showTitles',
Expand Down
3 changes: 1 addition & 2 deletions src/top/footer/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export const computeFooter = function ({
timestamp,
reporter,
reporter: {
format,
config: { showTitles, showMetadata, showSystem },
config: { format, showTitles, showMetadata, showSystem },
},
config: { titles },
}) {
Expand Down

0 comments on commit 4566303

Please sign in to comment.