GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: strip ANSI escape codes from snapshot output by parkerbxyz · Pull Request #412 · actions/create-github-app-token

Conversation

@parkerbxyz

@parkerbxyz parkerbxyz commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Strips ANSI escape codes from captured stdout and stderr before comparing test output to snapshots.

When FORCE_COLOR is set (some terminals and tools set it), Node colorizes logged errors, so main-token-get-owner-set-client-error.test.js fails locally even though it passes in CI. With this change, snapshots match regardless of color settings. CI output is unchanged.

Split out from #411.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@parkerbxyz @aiqiaoy
test: strip ANSI escape codes from snapshot output
bb438f4
Snapshots failed locally when FORCE_COLOR was set because Node colorizes
logged errors. Strip escape codes so snapshots match regardless of color
settings.

Co-authored-by: Aiqiao Yan <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@parkerbxyz
parkerbxyz requested a review from a team as a code owner November 16, 2026 17:17
Copilot AI balanced review requested due to automatic review settings November 16, 2026 17:17
Copilot started reviewing on behalf of parkerbxyz November 16, 2026 17:17
View session
Copilot AI reviewed Nov 16, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the test-harness change that strips terminal control sequences before snapshot comparison.

No open issues 🎉

What changed in this PR

Stabilizes snapshot tests when FORCE_COLOR is enabled, without changing production action behavior.

Changes:

  • Uses Node’s built-in stripVTControlCharacters to remove terminal control sequences from captured stdout and stderr before snapshot comparison, preserving existing trailing-newline trimming.
File Description
tests/​index.js Normalizes subprocess output in the shared snapshot test harness.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
parkerbxyz added a commit to aiqiaoy/create-github-app-token that referenced this pull request Nov 16, 2026
@parkerbxyz
test: split OIDC tests into snapshot scenarios
b8947d3
- Serve ID tokens from a local server instead of mocking @actions/core internals
- Add OIDC support to the shared test helper and log request query strings
- Move the ANSI stripping harness change to actions#412

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@parkerbxyz
parkerbxyz merged commit 01b8009 into main Nov 18, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@parkerbxyz
parkerbxyz deleted the test/strip-ansi-from-snapshots branch November 18, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@parkerbxyz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.