Skip to content

test: flake debugging - avoid logs being eaten by jest #78449

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

lubieowoce
Copy link
Member

follow up to #78424. annoyingly, it appears that the console.log output gets swallowed by jest somehow, so i'm using require('console') instead which jest doesn't instrument.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. tests labels Apr 23, 2025
@lubieowoce lubieowoce requested a review from huozhi April 23, 2025 11:22
@lubieowoce lubieowoce force-pushed the lubieowoce/debug-flaky-empty-div-test-again branch from 11b0985 to f88e389 Compare April 23, 2025 11:23
@lubieowoce lubieowoce merged commit f42ba51 into canary Apr 23, 2025
111 of 112 checks passed
@lubieowoce lubieowoce deleted the lubieowoce/debug-flaky-empty-div-test-again branch April 23, 2025 11:24
lubieowoce added a commit that referenced this pull request Apr 23, 2025
lubieowoce added a commit that referenced this pull request Apr 23, 2025
Some tests in `rsc-basic` asserts that certain nodes should be empty,
but streaming metadata can get in there and break that expectation.

- i switched the test to use a full browser. this is better than
checking the raw html, because then react gets rid of any `<template>`
tags inside the div (which are used for streaming SSR things)
- we're also now only asserting that the inner text of the node should
be empty, which avoids failures because of a `<div hidden>` inserted by
streaming metadata. this is a slightly weaker assertion than "this node
has no children at all" but it should be enough for our purposes here.

also reverts #78449 and #78424, they were meant for debugging this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js team PRs by the Next.js team. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants