Skip to content

fix: compat NO_COLOR env#509

Merged
9aoy merged 1 commit intomainfrom
NO_COLOR
Aug 26, 2025
Merged

fix: compat NO_COLOR env#509
9aoy merged 1 commit intomainfrom
NO_COLOR

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 26, 2025

Summary

img_v3_02ph_c8f04499-76f7-4253-8dcc-a702741f428g

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 26, 2025 07:50
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 26, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit c3f28a2
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68ad676151e5c00008ba0947
😎 Deploy Preview https://deploy-preview-509--rstest-dev.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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes compatibility with the NO_COLOR environment variable by modifying the FORCE_COLOR setting in the test environment configuration. The change ensures that when NO_COLOR is set to '1', color output is disabled by setting FORCE_COLOR to '0', otherwise it defaults to '1' to enable colors.

  • Updates FORCE_COLOR logic to respect NO_COLOR environment variable
  • Maintains backward compatibility by defaulting to colored output when NO_COLOR is not set

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

NODE_ENV: 'test',
// enable diff color by default
FORCE_COLOR: '1',
FORCE_COLOR: process.env.NO_COLOR === '1' ? '0' : '1',
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

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

The NO_COLOR environment variable should be checked for any truthy value, not just '1'. According to the NO_COLOR standard (https://no-color.org/), any non-empty value should disable colors. Consider using process.env.NO_COLOR ? '0' : '1' instead.

Suggested change
FORCE_COLOR: process.env.NO_COLOR === '1' ? '0' : '1',
FORCE_COLOR: process.env.NO_COLOR ? '0' : '1',

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 7f5ece4 into main Aug 26, 2025
17 of 19 checks passed
@9aoy 9aoy deleted the NO_COLOR branch August 26, 2025 08:27
@9aoy 9aoy mentioned this pull request Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants