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

Test highlighting of prettyDOM explicitly #1324

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Jul 5, 2024

Previous test setup hid legit bugs (e.g. #1322). Now we test prettyDOM in each environment (Browser and browser-ish (node+jsdom) on the exact colors by not stripping the ANSI color codes anymore.

Copy link

codesandbox-ci bot commented Jul 5, 2024

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 67dee41:

Sandbox Source
react-testing-library-examples Configuration

import {configure, getConfig} from '../config'
import {render, renderIntoDocument} from './helpers/test-utils'

expect.addSnapshotSerializer(jestSnapshotSerializerAnsi)
Copy link
Member Author

Choose a reason for hiding this comment

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

DRY tests are not desired. This helps noticing when tests ignore color coding.

src/__tests__/pretty-dom.js Outdated Show resolved Hide resolved
@eps1lon eps1lon marked this pull request as ready for review July 5, 2024 10:20
eps1lon added 3 commits July 5, 2024 12:56
They hide console logs which we shouldn't do for pretty-dom since that shouldn't console.log in the first place
@eps1lon eps1lon merged commit 33555a3 into testing-library:main Jul 22, 2024
4 checks passed
@eps1lon eps1lon deleted the color-tests branch July 22, 2024 10:03
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.

1 participant