Skip to content

Test highlighting of prettyDOM explicitly#1324

Merged
eps1lon merged 3 commits into
testing-library:mainfrom
eps1lon:color-tests
Jul 22, 2024
Merged

Test highlighting of prettyDOM explicitly#1324
eps1lon merged 3 commits into
testing-library:mainfrom
eps1lon:color-tests

Conversation

@eps1lon

@eps1lon eps1lon commented Jul 5, 2024

Copy link
Copy Markdown
Member

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.

@codesandbox-ci

codesandbox-ci Bot commented Jul 5, 2024

Copy link
Copy Markdown

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
Copy Markdown
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.

Comment thread src/__tests__/pretty-dom.js Outdated
@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
@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