这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug: ReactFlightAsyncDebugInfo test 'can track async information when awaited' fails due to snapshot mismatch #35130

@THE-Amrit-mahto-05

Description

@THE-Amrit-mahto-05

React version:Experimental / latest commit

Steps To Reproduce

  1. Clone the React repository.
  2. Run the following test:
    yarn test packages/react-server/src/tests/ReactFlightAsyncDebugInfo-test.js --testNamePattern="can track async information when awaited" --runInBand --verbose
  3. Observe that the test fails due to a snapshot mismatch.
prom.mov

-->

Link to code example: packages/react-server/src/tests/ReactFlightAsyncDebugInfo-test.js

Context: Snapshot Mismatch in ReactFlightAsyncDebugInfo-test

Failing Test Case

test("can track async information when awaited", async () => {
const result = await someAsyncFunction();
expect(getDebugInfo(result)).toMatchInlineSnapshot(Object { "value": undefined, });
});

implementation

export async function someAsyncFunction() {
return {
value: [undefined],
};
}
-->

Actual Output

Object {
  "value": [undefined],
}

-->

## The current behavior
The inline snapshot does not match the current output. The test expects `"value": undefined` but receives `"value": [ , ]`.

## The expected behavior
The test should pass and the snapshot should match the current output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions