Skip to content

chore: remove FORCE_COLOR workaround for Rstest - #112

Merged
chenjiahan merged 1 commit into
rstackjs:mainfrom
fi3ework:chore/remove-rstest-color-workaround
Sep 28, 2026
Merged

chenjiahan merged 1 commit into
rstackjs:mainfrom
fi3ework:chore/remove-rstest-color-workaround

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Motivation

Rstest used to inject FORCE_COLOR=1 into test worker processes (on a TTY or with CI=true), so styleText in makeCodeFrame / displayCodePointer produced ANSI codes and broke the plain-text snapshots. The env: { FORCE_COLOR: '0' } test config was added to work around that.

Since @rstest/core 0.12.2 (web-infra-dev/rstest#1893), Rstest no longer writes any color env into workers.

Changes

  • Upgrade rstack from ^0.7.4 to ^0.8.0. rstack 0.7.4 pins @rstest/core 0.11.12; 0.8.0 resolves @rstest/core 0.12.2.
  • Remove the define.test block, whose only option was the FORCE_COLOR override.

With CI=true, all tests pass without the override. On @rstest/core 0.12.1, the two snapshots in test/helpers.test.ts fail without it.

Upgrade rstack to ^0.8.0 so tests run on @rstest/core 0.12.2, which no longer injects FORCE_COLOR into test workers, and drop the env override.
@chenjiahan
chenjiahan merged commit d1772d1 into rstackjs:main Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants