Colors in Node 6 on Travis disabled when running 20+ suites
See original GitHub issuebug
What is the current behavior?
Hey I am seeing an issue with Jest in node 6 in jest-extended.
For some reason when there is more than 20 test suites being ran in Jest@22 and Node@6 then colors become disabled. Is this expected behaviour?
Under the hood jest-extended
is depending on a few bits from the core jest packages including pretty-format
(as a snapshot serialiser to store the ansi code as human readable strings) and the jest-matcher-utils
package for printing the error messages in the same format as the core Jest messages.
This means that when we test a matcher throws the correct message the snapshot contains the color (like in the core repo here).
A resulting knock on affect of depending on the core internals is that when colors are disabled the snapshots break.
What is the expected behavior?
I would expect colors to be used on all test suites regardless of number of suites being ran.
I’ve created a repo with steps to reproduce the issue I’m seeing here: https://github.com/mattphillips/jest-no-colors-node-6
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
node: v6.12.2 yarn: 1.2.1 jest: 22.1.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top GitHub Comments
@skratchdot @SimenB @thymikee FWIW I’m seeing the same on Node 6.14.1, but not on 8, 9, or 10. Not only are colors absent from the diff, but it’s also claiming that the snapshot comparison has failed, and it seems related to color codes:
For our use-case, the
--runInBand
switch seems to fix it. Weird.