Skip to content

Commit 3e6415c

Browse files
authored
fix(cli): missing failure counts when there is failedHooks (#4633)
1 parent 831f13e commit 3e6415c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/cli.js

-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ class Cli extends Base {
219219

220220
this.failures.forEach((failure) => {
221221
if (failure.constructor.name === 'Hook') {
222-
stats.failures -= stats.failures
223222
stats.failedHooks += 1
224223
}
225224
})

test/runner/before_failure_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Failure in before', function () {
1212
stdout.should.include('First test will be passed @grep')
1313
stdout.should.include('Third test will be skipped @grep')
1414
stdout.should.include('Fourth test will be skipped')
15-
stdout.should.include('1 passed, 1 failedHooks, 2 skipped')
15+
stdout.should.include('1 passed, 1 failed, 1 failedHooks, 2 skipped')
1616
err.code.should.eql(1)
1717
done()
1818
})
@@ -22,7 +22,7 @@ describe('Failure in before', function () {
2222
exec(`${codecept_run} --grep @grep`, (err, stdout) => {
2323
stdout.should.include('First test will be passed @grep')
2424
stdout.should.include('Third test will be skipped @grep')
25-
stdout.should.include('1 passed, 1 failedHooks, 1 skipped')
25+
stdout.should.include('1 passed, 1 failed, 1 failedHooks, 1 skipped')
2626
err.code.should.eql(1)
2727
done()
2828
})

test/runner/run_workers_test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ describe('CodeceptJS Workers Runner', function () {
4444
expect(stdout).not.toContain('this is running inside worker')
4545
expect(stdout).toContain('failed')
4646
expect(stdout).toContain('File notafile not found')
47-
expect(stdout).toContain('5 passed, 1 failed, 1 failedHooks')
47+
expect(stdout).toContain('Scenario Steps:')
48+
expect(stdout).toContain('5 passed, 2 failed, 1 failedHooks')
4849
// We are not testing order in logs, because it depends on race condition between workers
4950
expect(stdout).toContain(') Workers Failing\n') // first fail log
5051
expect(stdout).toContain(') Workers\n') // second fail log

0 commit comments

Comments
 (0)