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

feat: Allow disabling colorized debug output #1166

Merged
merged 1 commit into from
Sep 17, 2022

Conversation

MynockSpit
Copy link
Contributor

What:

Add an environment flag that allows turning off of colors from the command line.

Why:

Some environments current flag as "node", but print logs in formats that don't handle colorization which makes reading the logs hard to read.

More details here: #1153

How:

Changed the isNode function to shouldHighlight, and check for the environment variable before checking for the

Checklist:

  • Documentation added to the docs site
  • Tests
  • TypeScript definitions updated - N/A
  • Ready to be merged

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d79febc:

Sandbox Source
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Sep 10, 2022

Codecov Report

Merging #1166 (d79febc) into main (2a9ee25) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1166   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          990       996    +6     
  Branches       325       327    +2     
=========================================
+ Hits           990       996    +6     
Flag Coverage Δ
node-12 100.00% <100.00%> (ø)
node-14 100.00% <100.00%> (ø)
node-16 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pretty-dom.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@eps1lon
Copy link
Member

eps1lon commented Sep 11, 2022

Thanks. This needs documentation to acompany it.

@MynockSpit
Copy link
Contributor Author

I took a stab at updating the docs. Let me know what you think!

testing-library/testing-library-docs#1148

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks!

@eps1lon eps1lon changed the title add support for a COLORS environment variable feat: Allow disabling colorized debug output Sep 17, 2022
@eps1lon eps1lon merged commit c9b197c into testing-library:main Sep 17, 2022
@eps1lon
Copy link
Member

eps1lon commented Sep 17, 2022

@all-contributors add @MynockSpit for code

@allcontributors
Copy link
Contributor

@eps1lon

I've put up a pull request to add @MynockSpit! 🎉

@github-actions
Copy link

🎉 This PR is included in version 8.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants