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

example usage of @testing-library/react-render-stream #8414

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

phryneas
Copy link
Contributor

@phryneas phryneas commented Dec 7, 2024

I was just talking tests with @TkDodo and wanted to do a quick example on what a test with RRSTL would look like

Copy link

nx-cloud bot commented Dec 7, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3719a6c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3
✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Contributor

autofix-ci bot commented Dec 7, 2024

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

Copy link

pkg-pr-new bot commented Dec 7, 2024

Open in Stackblitz

More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8414

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@8414

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@8414

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@8414

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8414

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@8414

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@8414

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@8414

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@8414

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@8414

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@8414

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@8414

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@8414

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@8414

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@8414

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@8414

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@8414

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@8414

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@8414

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@8414

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@8414

commit: 3719a6c


await waitFor(() => rendered.getByText('data: 2'))

expect(renders).toBe(4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no need to explicitly assert on four renders anymore - we called takeRender four times, and we assert that no more renders will happen at the end of the test

@phryneas
Copy link
Contributor Author

phryneas commented Dec 7, 2024

the test failures here seem to be unrelated and from another test? 😅

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.

1 participant