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

feat(consistent-data-testid): add support for custom error message #719

Conversation

patriscus
Copy link
Contributor

Checks

Changes

  • Add customMessage as an optional field for the Options
  • Use '' as the default for customMessage
  • Add a new message id, used to display the custom message
  • Add a function to determine which message id to use, based on customMessage's value
  • Pass customMessage along in the data object when calling context.report()
  • Add test case
  • Update docs

Context

Fixes #718

@Belco90 Belco90 changed the title Consistent data testid: add support for custom message feat(consistent-data-testid): add support for custom error message Jan 23, 2023
@Belco90 Belco90 self-requested a review January 23, 2023 09:26
@Belco90 Belco90 added the enhancement New feature or request label Jan 23, 2023
Copy link
Member

@Belco90 Belco90 left a comment

Choose a reason for hiding this comment

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

Hi @patriscus! Thanks for your PR, it looks great in general. Just a couple of minor things and should be ready to go.

lib/rules/consistent-data-testid.ts Outdated Show resolved Hide resolved
tests/lib/rules/consistent-data-testid.test.ts Outdated Show resolved Hide resolved
@Belco90 Belco90 merged commit 79b380f into testing-library:main Jan 23, 2023
@github-actions
Copy link

🎉 This PR is included in version 5.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Belco90
Copy link
Member

Belco90 commented Jan 23, 2023

@all-contributors please add @patriscus for ideas, code, test

@allcontributors
Copy link
Contributor

@Belco90

I've put up a pull request to add @patriscus! 🎉

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

🎉 This PR is included in version 6.0.0-alpha.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

consistent-data-testid: add support for custom error message
2 participants