You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm rather sure that this is because chalk is being imported earlier and the default profile is built in a way that doesn't supportsColor.
Expected behavior
Setting FORCE_COLOR in the same process before calling runCLI should make the output colorized.
Actual behavior
The output is not colorized.
Additional context
I believe the issue has some importance, at least this behavior should be documented. When testing vscode extensions inside a extension host sometimes there is no reasonable way to preset the environment and export it from a parent process. True, one can add the export to the system initialization profile, but that's not friendly to collaborators, having this as part of the initialization of the suite is preferable (indeed this way it's at the same level than the non-functional runCLI(...colors: true...)).
@memeplex Thanks for your report. I am a little confused that you report a bug at jest version 27.4.5 but the foam repo still uses version 26. I tried to move process.env.FORCE_COLOR = '1'; after the import but cannot reproduce.
Could you extract a minimal reproduction repo for this bug report?
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
27.4.5
Steps to reproduce
(Not really steps to reproduce, but I've tracked down the problem after two hours of debugging, so please don't dismiss it too quickly)
In previous versions (26.2.2 is the one I tested) the following code:
printed a colorized output. Something changed in between and I now have to reorder it as follows:
I'm rather sure that this is because chalk is being imported earlier and the
default
profile is built in a way that doesn'tsupportsColor
.Expected behavior
Setting
FORCE_COLOR
in the same process before callingrunCLI
should make the output colorized.Actual behavior
The output is not colorized.
Additional context
I believe the issue has some importance, at least this behavior should be documented. When testing vscode extensions inside a extension host sometimes there is no reasonable way to preset the environment and export it from a parent process. True, one can add the export to the system initialization profile, but that's not friendly to collaborators, having this as part of the initialization of the suite is preferable (indeed this way it's at the same level than the non-functional
runCLI(...colors: true...)
).Environment
System: OS: macOS 11.6 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Binaries: Node: 17.0.1 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/bin/npm npmPackages: jest: ^27.4.5 => 27.4.5
The text was updated successfully, but these errors were encountered: