@jest/reporters
Advanced tools
Comparing version 28.0.0-alpha.5 to 28.0.0-alpha.6
@@ -30,3 +30,3 @@ 'use strict'; | ||
log(message) { | ||
process.stderr.write(message + '\n'); | ||
process.stderr.write(`${message}\n`); | ||
} | ||
@@ -33,0 +33,0 @@ |
@@ -213,10 +213,7 @@ 'use strict'; | ||
this.log( | ||
' ' + | ||
TITLE_BULLET + | ||
'Console\n\n' + | ||
(0, _console().getConsoleOutput)( | ||
result.console, | ||
config, | ||
this._globalConfig | ||
) | ||
` ${TITLE_BULLET}Console\n\n${(0, _console().getConsoleOutput)( | ||
result.console, | ||
config, | ||
this._globalConfig | ||
)}` | ||
); | ||
@@ -223,0 +220,0 @@ } |
@@ -98,8 +98,7 @@ 'use strict'; | ||
projectConfig && projectConfig.displayName | ||
? (0, _utils.printDisplayName)(projectConfig) + ' ' | ||
? `${(0, _utils.printDisplayName)(projectConfig)} ` | ||
: ''; | ||
return ( | ||
`${status} ${projectDisplayName}${fileLink}` + | ||
(testDetail.length ? ` (${testDetail.join(', ')})` : '') | ||
); | ||
return `${status} ${projectDisplayName}${fileLink}${ | ||
testDetail.length ? ` (${testDetail.join(', ')})` : '' | ||
}`; | ||
} |
@@ -55,5 +55,5 @@ 'use strict'; | ||
SNAPSHOT_ADDED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshot.added) + | ||
' written.' | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshot.added) | ||
} written.` | ||
) | ||
@@ -66,5 +66,5 @@ ); | ||
SNAPSHOT_UPDATED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshot.updated) + | ||
' updated.' | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshot.updated) | ||
} updated.` | ||
) | ||
@@ -77,5 +77,5 @@ ); | ||
FAIL_COLOR( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshot.unmatched) + | ||
' failed.' | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshot.unmatched) | ||
} failed.` | ||
) | ||
@@ -89,5 +89,5 @@ ); | ||
SNAPSHOT_UPDATED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) + | ||
' removed.' | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) | ||
} removed.` | ||
) | ||
@@ -97,7 +97,7 @@ ); | ||
statuses.push( | ||
SNAPSHOT_OUTDATED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) + | ||
' obsolete' | ||
) + '.' | ||
`${SNAPSHOT_OUTDATED( | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshot.unchecked) | ||
} obsolete` | ||
)}.` | ||
); | ||
@@ -112,3 +112,3 @@ } | ||
if (snapshot.fileDeleted) { | ||
statuses.push(SNAPSHOT_UPDATED(ARROW + 'snapshot file removed.')); | ||
statuses.push(SNAPSHOT_UPDATED(`${ARROW}snapshot file removed.`)); | ||
} | ||
@@ -115,0 +115,0 @@ |
@@ -64,11 +64,7 @@ 'use strict'; | ||
summary.push( | ||
SNAPSHOT_ADDED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshots.added) + | ||
' written ' | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesAdded | ||
)}.` | ||
`${SNAPSHOT_ADDED( | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshots.added) | ||
} written ` | ||
)}from ${(0, _jestUtil().pluralize)('test suite', snapshots.filesAdded)}.` | ||
); | ||
@@ -79,3 +75,3 @@ } | ||
summary.push( | ||
FAIL_COLOR( | ||
`${FAIL_COLOR( | ||
`${ARROW}${(0, _jestUtil().pluralize)( | ||
@@ -85,10 +81,8 @@ 'snapshot', | ||
)} failed` | ||
) + | ||
` from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesUnmatched | ||
)}. ` + | ||
SNAPSHOT_NOTE( | ||
'Inspect your code changes or ' + updateCommand + ' to update them.' | ||
) | ||
)} from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesUnmatched | ||
)}. ${SNAPSHOT_NOTE( | ||
`Inspect your code changes or ${updateCommand} to update them.` | ||
)}` | ||
); | ||
@@ -99,11 +93,10 @@ } | ||
summary.push( | ||
SNAPSHOT_UPDATED( | ||
ARROW + | ||
(0, _jestUtil().pluralize)('snapshot', snapshots.updated) + | ||
' updated ' | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesUpdated | ||
)}.` | ||
`${SNAPSHOT_UPDATED( | ||
`${ | ||
ARROW + (0, _jestUtil().pluralize)('snapshot', snapshots.updated) | ||
} updated ` | ||
)}from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesUpdated | ||
)}.` | ||
); | ||
@@ -115,3 +108,3 @@ } | ||
summary.push( | ||
SNAPSHOT_REMOVED( | ||
`${SNAPSHOT_REMOVED( | ||
`${ARROW}${(0, _jestUtil().pluralize)( | ||
@@ -121,11 +114,10 @@ 'snapshot file', | ||
)} removed ` | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesRemoved | ||
)}.` | ||
)}from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesRemoved | ||
)}.` | ||
); | ||
} else { | ||
summary.push( | ||
OBSOLETE_COLOR( | ||
`${OBSOLETE_COLOR( | ||
`${ARROW}${(0, _jestUtil().pluralize)( | ||
@@ -135,12 +127,10 @@ 'snapshot file', | ||
)} obsolete ` | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesRemoved | ||
)}. ` + | ||
SNAPSHOT_NOTE( | ||
`To remove ${ | ||
snapshots.filesRemoved === 1 ? 'it' : 'them all' | ||
}, ${updateCommand}.` | ||
) | ||
)}from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.filesRemoved | ||
)}. ${SNAPSHOT_NOTE( | ||
`To remove ${ | ||
snapshots.filesRemoved === 1 ? 'it' : 'them all' | ||
}, ${updateCommand}.` | ||
)}` | ||
); | ||
@@ -165,3 +155,3 @@ } | ||
summary.push( | ||
SNAPSHOT_REMOVED( | ||
`${SNAPSHOT_REMOVED( | ||
`${ARROW}${(0, _jestUtil().pluralize)( | ||
@@ -171,11 +161,10 @@ 'snapshot', | ||
)} removed ` | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.uncheckedKeysByFile.length | ||
)}.` | ||
)}from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.uncheckedKeysByFile.length | ||
)}.` | ||
); | ||
} else { | ||
summary.push( | ||
OBSOLETE_COLOR( | ||
`${OBSOLETE_COLOR( | ||
`${ARROW}${(0, _jestUtil().pluralize)( | ||
@@ -185,12 +174,10 @@ 'snapshot', | ||
)} obsolete ` | ||
) + | ||
`from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.uncheckedKeysByFile.length | ||
)}. ` + | ||
SNAPSHOT_NOTE( | ||
`To remove ${ | ||
snapshots.unchecked === 1 ? 'it' : 'them all' | ||
}, ${updateCommand}.` | ||
) | ||
)}from ${(0, _jestUtil().pluralize)( | ||
'test suite', | ||
snapshots.uncheckedKeysByFile.length | ||
)}. ${SNAPSHOT_NOTE( | ||
`To remove ${ | ||
snapshots.unchecked === 1 ? 'it' : 'them all' | ||
}, ${updateCommand}.` | ||
)}` | ||
); | ||
@@ -197,0 +184,0 @@ } |
@@ -160,2 +160,3 @@ 'use strict'; | ||
this._notifier.notify({ | ||
hint: 'int:transient:1', | ||
icon, | ||
@@ -182,3 +183,3 @@ message, | ||
const message = util().format( | ||
(isDarwin ? '\u26D4\uFE0F ' : '') + '%d of %d tests failed', | ||
`${isDarwin ? '\u26D4\uFE0F ' : ''}%d of %d tests failed`, | ||
result.numFailedTests, | ||
@@ -193,2 +194,3 @@ result.numTotalTests | ||
this._notifier.notify({ | ||
hint: 'int:transient:1', | ||
icon, | ||
@@ -202,4 +204,6 @@ message, | ||
{ | ||
// @ts-expect-error - not all options are supported by all systems (specifically `actions` and `hint`) | ||
actions: [restartAnswer, quitAnswer], | ||
closeLabel: 'Close', | ||
hint: 'int:transient:1', | ||
icon, | ||
@@ -206,0 +210,0 @@ message, |
@@ -41,3 +41,3 @@ 'use strict'; | ||
const RUNNING_TEXT = ' RUNS '; | ||
const RUNNING = _chalk().default.reset.inverse.yellow.bold(RUNNING_TEXT) + ' '; | ||
const RUNNING = `${_chalk().default.reset.inverse.yellow.bold(RUNNING_TEXT)} `; | ||
/** | ||
@@ -190,16 +190,15 @@ * This class is a perf optimization for sorting the list of currently | ||
const projectDisplayName = config.displayName | ||
? (0, _utils.printDisplayName)(config) + ' ' | ||
? `${(0, _utils.printDisplayName)(config)} ` | ||
: ''; | ||
const prefix = RUNNING + projectDisplayName; | ||
content += | ||
(0, _utils.wrapAnsiString)( | ||
prefix + | ||
(0, _utils.trimAndFormatPath)( | ||
(0, _stringLength().default)(prefix), | ||
config, | ||
testPath, | ||
width | ||
), | ||
width | ||
) + '\n'; | ||
content += `${(0, _utils.wrapAnsiString)( | ||
prefix + | ||
(0, _utils.trimAndFormatPath)( | ||
(0, _stringLength().default)(prefix), | ||
config, | ||
testPath, | ||
width | ||
), | ||
width | ||
)}\n`; | ||
} | ||
@@ -209,10 +208,8 @@ }); | ||
if (this._showStatus && this._aggregatedResults) { | ||
content += | ||
'\n' + | ||
(0, _utils.getSummary)(this._aggregatedResults, { | ||
currentTestCases: this._currentTestCases, | ||
estimatedTime: this._estimatedTime, | ||
roundTime: true, | ||
width | ||
}); | ||
content += `\n${(0, _utils.getSummary)(this._aggregatedResults, { | ||
currentTestCases: this._currentTestCases, | ||
estimatedTime: this._estimatedTime, | ||
roundTime: true, | ||
width | ||
})}`; | ||
} | ||
@@ -219,0 +216,0 @@ |
@@ -133,7 +133,7 @@ 'use strict'; | ||
if (!this._globalConfig.silent) { | ||
message += | ||
'\n' + | ||
(wasInterrupted | ||
message += `\n${ | ||
wasInterrupted | ||
? _chalk().default.bold.red('Test run was interrupted.') | ||
: this._getTestSummary(contexts, this._globalConfig)); | ||
: this._getTestSummary(contexts, this._globalConfig) | ||
}`; | ||
} | ||
@@ -168,5 +168,5 @@ | ||
} else if (event && scriptUsesJest) { | ||
updateCommand = `run \`${ | ||
client + ' ' + prefix + event + (isYarn ? '' : ' --') | ||
} -u\``; | ||
updateCommand = `run \`${`${client} ${prefix}${event}${ | ||
isYarn ? '' : ' --' | ||
}`} -u\``; | ||
} else { | ||
@@ -202,6 +202,6 @@ updateCommand = 're-run jest with `-u`'; | ||
this._write( | ||
(0, _getResultHeader.default)(testResult, globalConfig) + | ||
'\n' + | ||
failureMessage + | ||
'\n' | ||
`${(0, _getResultHeader.default)( | ||
testResult, | ||
globalConfig | ||
)}\n${failureMessage}\n` | ||
); | ||
@@ -240,7 +240,7 @@ } | ||
if (globalConfig.runTestsByPath) { | ||
nameInfo = ' ' + globalConfig.nonFlagArgs.map(p => `"${p}"`).join(', '); | ||
nameInfo = ` ${globalConfig.nonFlagArgs.map(p => `"${p}"`).join(', ')}`; | ||
} else if (globalConfig.testNamePattern) { | ||
nameInfo = | ||
_chalk().default.dim(' with tests matching ') + | ||
`"${globalConfig.testNamePattern}"`; | ||
nameInfo = `${_chalk().default.dim(' with tests matching ')}"${ | ||
globalConfig.testNamePattern | ||
}"`; | ||
} | ||
@@ -247,0 +247,0 @@ |
@@ -143,4 +143,6 @@ 'use strict'; | ||
const dirnameLength = maxLength - 4 - basenameLength; | ||
dirname = | ||
'...' + dirname.slice(dirname.length - dirnameLength, dirname.length); | ||
dirname = `...${dirname.slice( | ||
dirname.length - dirnameLength, | ||
dirname.length | ||
)}`; | ||
return (0, _slash().default)( | ||
@@ -154,3 +156,3 @@ _chalk().default.dim(dirname + path().sep) + | ||
return (0, _slash().default)( | ||
_chalk().default.dim('...' + path().sep) + _chalk().default.bold(basename) | ||
_chalk().default.dim(`...${path().sep}`) + _chalk().default.bold(basename) | ||
); | ||
@@ -161,3 +163,3 @@ } // can't fit dirname, but can fit trimmed basename | ||
_chalk().default.bold( | ||
'...' + basename.slice(basename.length - maxLength - 4, basename.length) | ||
`...${basename.slice(basename.length - maxLength - 4, basename.length)}` | ||
) | ||
@@ -264,17 +266,15 @@ ); | ||
const width = (options && options.width) || 0; | ||
const suites = | ||
const suites = `${ | ||
_chalk().default.bold('Test Suites: ') + | ||
(suitesFailed | ||
? _chalk().default.bold.red(`${suitesFailed} failed`) + ', ' | ||
? `${_chalk().default.bold.red(`${suitesFailed} failed`)}, ` | ||
: '') + | ||
(suitesPending | ||
? _chalk().default.bold.yellow(`${suitesPending} skipped`) + ', ' | ||
? `${_chalk().default.bold.yellow(`${suitesPending} skipped`)}, ` | ||
: '') + | ||
(suitesPassed | ||
? _chalk().default.bold.green(`${suitesPassed} passed`) + ', ' | ||
? `${_chalk().default.bold.green(`${suitesPassed} passed`)}, ` | ||
: '') + | ||
(suitesRun !== suitesTotal | ||
? suitesRun + ' of ' + suitesTotal | ||
: suitesTotal) + | ||
' total'; | ||
(suitesRun !== suitesTotal ? `${suitesRun} of ${suitesTotal}` : suitesTotal) | ||
} total`; | ||
const updatedTestsFailed = | ||
@@ -289,49 +289,51 @@ testsFailed + valuesForCurrentTestCases.numFailingTests; | ||
testsTotal + valuesForCurrentTestCases.numTotalTests; | ||
const tests = | ||
const tests = `${ | ||
_chalk().default.bold('Tests: ') + | ||
(updatedTestsFailed > 0 | ||
? _chalk().default.bold.red(`${updatedTestsFailed} failed`) + ', ' | ||
? `${_chalk().default.bold.red(`${updatedTestsFailed} failed`)}, ` | ||
: '') + | ||
(updatedTestsPending > 0 | ||
? _chalk().default.bold.yellow(`${updatedTestsPending} skipped`) + ', ' | ||
? `${_chalk().default.bold.yellow(`${updatedTestsPending} skipped`)}, ` | ||
: '') + | ||
(updatedTestsTodo > 0 | ||
? _chalk().default.bold.magenta(`${updatedTestsTodo} todo`) + ', ' | ||
? `${_chalk().default.bold.magenta(`${updatedTestsTodo} todo`)}, ` | ||
: '') + | ||
(updatedTestsPassed > 0 | ||
? _chalk().default.bold.green(`${updatedTestsPassed} passed`) + ', ' | ||
: '') + | ||
`${updatedTestsTotal} total`; | ||
const snapshots = | ||
? `${_chalk().default.bold.green(`${updatedTestsPassed} passed`)}, ` | ||
: '') | ||
}${updatedTestsTotal} total`; | ||
const snapshots = `${ | ||
_chalk().default.bold('Snapshots: ') + | ||
(snapshotsFailed | ||
? _chalk().default.bold.red(`${snapshotsFailed} failed`) + ', ' | ||
? `${_chalk().default.bold.red(`${snapshotsFailed} failed`)}, ` | ||
: '') + | ||
(snapshotsOutdated && !snapshotsDidUpdate | ||
? _chalk().default.bold.yellow(`${snapshotsOutdated} obsolete`) + ', ' | ||
? `${_chalk().default.bold.yellow(`${snapshotsOutdated} obsolete`)}, ` | ||
: '') + | ||
(snapshotsOutdated && snapshotsDidUpdate | ||
? _chalk().default.bold.green(`${snapshotsOutdated} removed`) + ', ' | ||
? `${_chalk().default.bold.green(`${snapshotsOutdated} removed`)}, ` | ||
: '') + | ||
(snapshotsFilesRemoved && !snapshotsDidUpdate | ||
? _chalk().default.bold.yellow( | ||
(0, _jestUtil().pluralize)('file', snapshotsFilesRemoved) + | ||
' obsolete' | ||
) + ', ' | ||
? `${_chalk().default.bold.yellow( | ||
`${(0, _jestUtil().pluralize)( | ||
'file', | ||
snapshotsFilesRemoved | ||
)} obsolete` | ||
)}, ` | ||
: '') + | ||
(snapshotsFilesRemoved && snapshotsDidUpdate | ||
? _chalk().default.bold.green( | ||
(0, _jestUtil().pluralize)('file', snapshotsFilesRemoved) + ' removed' | ||
) + ', ' | ||
? `${_chalk().default.bold.green( | ||
`${(0, _jestUtil().pluralize)('file', snapshotsFilesRemoved)} removed` | ||
)}, ` | ||
: '') + | ||
(snapshotsUpdated | ||
? _chalk().default.bold.green(`${snapshotsUpdated} updated`) + ', ' | ||
? `${_chalk().default.bold.green(`${snapshotsUpdated} updated`)}, ` | ||
: '') + | ||
(snapshotsAdded | ||
? _chalk().default.bold.green(`${snapshotsAdded} written`) + ', ' | ||
? `${_chalk().default.bold.green(`${snapshotsAdded} written`)}, ` | ||
: '') + | ||
(snapshotsPassed | ||
? _chalk().default.bold.green(`${snapshotsPassed} passed`) + ', ' | ||
: '') + | ||
`${snapshotsTotal} total`; | ||
? `${_chalk().default.bold.green(`${snapshotsPassed} passed`)}, ` | ||
: '') | ||
}${snapshotsTotal} total`; | ||
const time = renderTime(runTime, estimatedTime, width); | ||
@@ -349,3 +351,3 @@ return [suites, tests, snapshots, time].join('\n'); | ||
: (0, _jestUtil().formatTime)(runTime, 0); | ||
let time = _chalk().default.bold('Time:') + ` ${renderedTime}`; | ||
let time = `${_chalk().default.bold('Time:')} ${renderedTime}`; | ||
@@ -365,8 +367,5 @@ if (runTime < estimatedTime) { | ||
if (availableWidth >= 2) { | ||
time += | ||
'\n' + | ||
_chalk().default.green('█').repeat(length) + | ||
_chalk() | ||
.default.white('█') | ||
.repeat(availableWidth - length); | ||
time += `\n${_chalk().default.green('█').repeat(length)}${_chalk() | ||
.default.white('█') | ||
.repeat(availableWidth - length)}`; | ||
} | ||
@@ -373,0 +372,0 @@ } |
@@ -160,3 +160,3 @@ 'use strict'; | ||
this._logLine( | ||
status + ' ' + _chalk().default.dim(test.title + time), | ||
`${status} ${_chalk().default.dim(test.title + time)}`, | ||
indentLevel | ||
@@ -163,0 +163,0 @@ ); |
{ | ||
"name": "@jest/reporters", | ||
"description": "Jest's reporters", | ||
"version": "28.0.0-alpha.5", | ||
"version": "28.0.0-alpha.6", | ||
"main": "./build/index.js", | ||
@@ -16,6 +16,6 @@ "types": "./build/index.d.ts", | ||
"@bcoe/v8-coverage": "^0.2.3", | ||
"@jest/console": "^28.0.0-alpha.5", | ||
"@jest/test-result": "^28.0.0-alpha.5", | ||
"@jest/transform": "^28.0.0-alpha.5", | ||
"@jest/types": "^28.0.0-alpha.5", | ||
"@jest/console": "^28.0.0-alpha.6", | ||
"@jest/test-result": "^28.0.0-alpha.6", | ||
"@jest/transform": "^28.0.0-alpha.6", | ||
"@jest/types": "^28.0.0-alpha.6", | ||
"@types/node": "*", | ||
@@ -32,6 +32,6 @@ "chalk": "^4.0.0", | ||
"istanbul-reports": "^3.1.3", | ||
"jest-haste-map": "^28.0.0-alpha.5", | ||
"jest-resolve": "^28.0.0-alpha.5", | ||
"jest-util": "^28.0.0-alpha.5", | ||
"jest-worker": "^28.0.0-alpha.5", | ||
"jest-haste-map": "^28.0.0-alpha.6", | ||
"jest-resolve": "^28.0.0-alpha.6", | ||
"jest-util": "^28.0.0-alpha.6", | ||
"jest-worker": "^28.0.0-alpha.6", | ||
"slash": "^3.0.0", | ||
@@ -44,3 +44,3 @@ "source-map": "^0.6.0", | ||
"devDependencies": { | ||
"@jest/test-utils": "^28.0.0-alpha.5", | ||
"@jest/test-utils": "^28.0.0-alpha.6", | ||
"@types/exit": "^0.1.30", | ||
@@ -82,3 +82,3 @@ "@types/glob": "^7.1.1", | ||
}, | ||
"gitHead": "46fb19b2628bd87676c10730ba19592c30b05478" | ||
"gitHead": "6284ada4adb7008f5f8673b1a7b1c789d2e508fb" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92003
2887