Skip to content

Conversation

@hainenber
Copy link
Contributor

@hainenber hainenber commented Oct 12, 2025

Summary

Fixes #15747

The console output for each test result is already available and with proper conditions, we can display them out for better debugging UX

Before
image

After
image

Test plan

… by test file

Signed-off-by: hainenber <dotronghai96@gmail.com>
@netlify
Copy link

netlify bot commented Oct 12, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a386875
🔍 Latest deploy log https://app.netlify.com/projects/jestjs/deploys/68ff89c37471b000095e409d
😎 Deploy Preview https://deploy-preview-15864--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

): string {
const TITLE_INDENT =
globalConfig.verbose === true ? ' '.repeat(2) : ' '.repeat(4);
globalConfig?.verbose === true ? ' '.repeat(2) : ' '.repeat(4);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to add verbose nullish check for double assurance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is it missing? types says it shouldn't be

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I was doing nullish check on globalConfig instead 😮‍💨 . Will revert in next revision.

Signed-off-by: hainenber <dotronghai96@gmail.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 12, 2025

Open in StackBlitz

babel-jest

npm i https://pkg.pr.new/babel-jest@15864

babel-plugin-jest-hoist

npm i https://pkg.pr.new/babel-plugin-jest-hoist@15864

babel-preset-jest

npm i https://pkg.pr.new/babel-preset-jest@15864

create-jest

npm i https://pkg.pr.new/create-jest@15864

@jest/diff-sequences

npm i https://pkg.pr.new/@jest/diff-sequences@15864

expect

npm i https://pkg.pr.new/expect@15864

@jest/expect-utils

npm i https://pkg.pr.new/@jest/expect-utils@15864

jest

npm i https://pkg.pr.new/jest@15864

jest-changed-files

npm i https://pkg.pr.new/jest-changed-files@15864

jest-circus

npm i https://pkg.pr.new/jest-circus@15864

jest-cli

npm i https://pkg.pr.new/jest-cli@15864

jest-config

npm i https://pkg.pr.new/jest-config@15864

@jest/console

npm i https://pkg.pr.new/@jest/console@15864

@jest/core

npm i https://pkg.pr.new/@jest/core@15864

@jest/create-cache-key-function

npm i https://pkg.pr.new/@jest/create-cache-key-function@15864

jest-diff

npm i https://pkg.pr.new/jest-diff@15864

jest-docblock

npm i https://pkg.pr.new/jest-docblock@15864

jest-each

npm i https://pkg.pr.new/jest-each@15864

@jest/environment

npm i https://pkg.pr.new/@jest/environment@15864

jest-environment-jsdom

npm i https://pkg.pr.new/jest-environment-jsdom@15864

@jest/environment-jsdom-abstract

npm i https://pkg.pr.new/@jest/environment-jsdom-abstract@15864

jest-environment-node

npm i https://pkg.pr.new/jest-environment-node@15864

@jest/expect

npm i https://pkg.pr.new/@jest/expect@15864

@jest/fake-timers

npm i https://pkg.pr.new/@jest/fake-timers@15864

@jest/get-type

npm i https://pkg.pr.new/@jest/get-type@15864

@jest/globals

npm i https://pkg.pr.new/@jest/globals@15864

jest-haste-map

npm i https://pkg.pr.new/jest-haste-map@15864

jest-jasmine2

npm i https://pkg.pr.new/jest-jasmine2@15864

jest-leak-detector

npm i https://pkg.pr.new/jest-leak-detector@15864

jest-matcher-utils

npm i https://pkg.pr.new/jest-matcher-utils@15864

jest-message-util

npm i https://pkg.pr.new/jest-message-util@15864

jest-mock

npm i https://pkg.pr.new/jest-mock@15864

@jest/pattern

npm i https://pkg.pr.new/@jest/pattern@15864

jest-phabricator

npm i https://pkg.pr.new/jest-phabricator@15864

jest-regex-util

npm i https://pkg.pr.new/jest-regex-util@15864

@jest/reporters

npm i https://pkg.pr.new/@jest/reporters@15864

jest-resolve

npm i https://pkg.pr.new/jest-resolve@15864

jest-resolve-dependencies

npm i https://pkg.pr.new/jest-resolve-dependencies@15864

jest-runner

npm i https://pkg.pr.new/jest-runner@15864

jest-runtime

npm i https://pkg.pr.new/jest-runtime@15864

@jest/schemas

npm i https://pkg.pr.new/@jest/schemas@15864

jest-snapshot

npm i https://pkg.pr.new/jest-snapshot@15864

@jest/snapshot-utils

npm i https://pkg.pr.new/@jest/snapshot-utils@15864

@jest/source-map

npm i https://pkg.pr.new/@jest/source-map@15864

@jest/test-result

npm i https://pkg.pr.new/@jest/test-result@15864

@jest/test-sequencer

npm i https://pkg.pr.new/@jest/test-sequencer@15864

@jest/transform

npm i https://pkg.pr.new/@jest/transform@15864

@jest/types

npm i https://pkg.pr.new/@jest/types@15864

jest-util

npm i https://pkg.pr.new/jest-util@15864

jest-validate

npm i https://pkg.pr.new/jest-validate@15864

jest-watcher

npm i https://pkg.pr.new/jest-watcher@15864

jest-worker

npm i https://pkg.pr.new/jest-worker@15864

pretty-format

npm i https://pkg.pr.new/pretty-format@15864

commit: a386875

@hainenber
Copy link
Contributor Author

@SimenB not urgent but if you have time, can you review this PR? I have added E2E test and with testimonial from affected user.

Thanks in advanced 🙏

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, thanks! just some nits 🙂

CHANGELOG.md Outdated

- `[jest-runtime]` Fix issue where user cannot utilize dynamic import despite specifying `--experimental-vm-modules` Node option ([#15842](https://github.com/jestjs/jest/pull/15842))
- `[jest-test-sequencer]` Fix issue where failed tests due to compilation errors not getting re-executed even with `--onlyFailures` CLI option ([#15851](https://github.com/jestjs/jest/pull/15851))
- `[jest-reporters]` Fix issue where console output not displayed for GHA reporter even with `silent: false` option ([#15864](https://github.com/jestjs/jest/pull/15864))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind putting the entries alphabetically?

Comment on lines 729 to 731
const gha = new GitHubActionsReporter({} as Config.GlobalConfig, {
silent: false,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use helpers from @jest/test-utils to create global and project configs

export const makeGlobalConfig = (
overrides: Partial<Config.GlobalConfig> = {},
): Config.GlobalConfig => {
const overridesKeys = new Set(Object.keys(overrides));
for (const key of Object.keys(DEFAULT_GLOBAL_CONFIG)) {
overridesKeys.delete(key);
}
if (overridesKeys.size > 0) {
throw new Error(`
Properties that are not part of GlobalConfig type were passed:
${JSON.stringify([...overridesKeys])}
`);
}
return {...DEFAULT_GLOBAL_CONFIG, ...overrides};
};
export const makeProjectConfig = (
overrides: Partial<Config.ProjectConfig> = {},
): Config.ProjectConfig => {
const overridesKeys = new Set(Object.keys(overrides));
for (const key of Object.keys(DEFAULT_PROJECT_CONFIG)) {
overridesKeys.delete(key);
}
if (overridesKeys.size > 0) {
throw new Error(`
Properties that are not part of ProjectConfig type were passed:
${JSON.stringify([...overridesKeys])}
`);
}
return {...DEFAULT_PROJECT_CONFIG, ...overrides};
};

hainenber and others added 3 commits October 27, 2025 21:55
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber requested a review from SimenB October 27, 2025 15:37
@hainenber
Copy link
Contributor Author

CI is green now. PTAL when you have time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Github Actions reporter swallows console output

2 participants