Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,10 @@ Enable it manually on each run via `-p` option:

npx codeceptjs run -p pauseOnFail

## reportData

TypeScript: Explicitly type reportData arrays as any\[] to avoid 'never' errors

## retryFailedStep

Retries each failed step in a test.
Expand Down
4 changes: 2 additions & 2 deletions lib/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,10 @@ module.exports = {
/**
* @param {Mocha.Test} test
*/

started(test) {
if (outputLevel < 1) return
print(` ${colors.dim.bold('Scenario()')}`)
},

/**
* @param {Mocha.Test} test
*/
Expand Down Expand Up @@ -273,10 +271,12 @@ module.exports = {
},

/**
* Prints the stats of a test run to the console.
* @param {number} passed
* @param {number} failed
* @param {number} skipped
* @param {number|string} duration
* @param {number} [failedHooks]
*/
result(passed, failed, skipped, duration, failedHooks = 0) {
let style = colors.bgGreen
Expand Down
11 changes: 8 additions & 3 deletions lib/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const { serializeTest } = require('./mocha/test')
* @property {number} duration Duration of the test run, in milliseconds.
*/

/**
* @typedef {Array<string|number>} Failure
* A detailed formatted report for a failed test.
*/

/**
* Result of a test run. Will be emitted for example in "event.all.result" events.
*/
Expand Down Expand Up @@ -48,7 +53,7 @@ class Result {
this._tests = []

/**
* @type {string[][]}
* @type {Failure[]}
* @private
*/
this._failures = []
Expand Down Expand Up @@ -91,7 +96,7 @@ class Result {
/**
* The failure reports (array of strings per failed test).
*
* @type {string[][]}
* @type {Failure[]}
* @readonly
*/
get failures() {
Expand Down Expand Up @@ -136,7 +141,7 @@ class Result {
/**
* Adds failure reports to this result.
*
* @param {string[][]} newFailures
* @param {Failure[]} newFailures
*/
addFailures(newFailures) {
this._failures.push(...newFailures)
Expand Down