Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): missing failure counts when there is failedHooks #4633

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
1 change: 0 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ class Cli extends Base {

this.failures.forEach((failure) => {
if (failure.constructor.name === 'Hook') {
stats.failures -= stats.failures
stats.failedHooks += 1
}
})
Expand Down
4 changes: 2 additions & 2 deletions test/runner/before_failure_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Failure in before', function () {
stdout.should.include('First test will be passed @grep')
stdout.should.include('Third test will be skipped @grep')
stdout.should.include('Fourth test will be skipped')
stdout.should.include('1 passed, 1 failedHooks, 2 skipped')
stdout.should.include('1 passed, 1 failed, 1 failedHooks, 2 skipped')
err.code.should.eql(1)
done()
})
Expand All @@ -22,7 +22,7 @@ describe('Failure in before', function () {
exec(`${codecept_run} --grep @grep`, (err, stdout) => {
stdout.should.include('First test will be passed @grep')
stdout.should.include('Third test will be skipped @grep')
stdout.should.include('1 passed, 1 failedHooks, 1 skipped')
stdout.should.include('1 passed, 1 failed, 1 failedHooks, 1 skipped')
err.code.should.eql(1)
done()
})
Expand Down
3 changes: 2 additions & 1 deletion test/runner/run_workers_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ describe('CodeceptJS Workers Runner', function () {
expect(stdout).not.toContain('this is running inside worker')
expect(stdout).toContain('failed')
expect(stdout).toContain('File notafile not found')
expect(stdout).toContain('5 passed, 1 failed, 1 failedHooks')
expect(stdout).toContain('Scenario Steps:')
expect(stdout).toContain('5 passed, 2 failed, 1 failedHooks')
// We are not testing order in logs, because it depends on race condition between workers
expect(stdout).toContain(') Workers Failing\n') // first fail log
expect(stdout).toContain(') Workers\n') // second fail log
Expand Down
Loading