question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colors in Node 6 on Travis disabled when running 20+ suites

See original GitHub issue

bug

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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shellscapecommented, Jun 1, 2018

@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:

Imgur

1reaction
skratchdotcommented, Apr 20, 2018

For our use-case, the --runInBand switch seems to fix it. Weird.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests passing: Build fails · Issue #7986 · travis-ci ... - GitHub
So I'm trying to use travis in my Angular 4 projet, all tests are passing ... 2.35s$ nvm install 6 Downloading and installing...
Read more >
Support ANSI color codes / Suggestions / Discussion Area
I'm used to using Travis CI and they manage to encode it to HTML. They support only the colors and style encoding but...
Read more >
How to enable output colors on nodejs running as systemd ...
I have a websocket client that sends periodically some message to websocket server. If I run the client from the tty, console colors...
Read more >
Node.js v19.3.0 Documentation
Runs a function synchronously outside of a context and returns its return value. The store is not accessible within the callback function or...
Read more >
Building a JavaScript and Node.js project - Travis CI Docs
lock exists, the default test command will be yarn test instead of npm test . Using other Test Suites #. You can tell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found