ReactMultiChild-test.js — react Source File
Architecture documentation for ReactMultiChild-test.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails react-core
*/
'use strict';
describe('ReactMultiChild', () => {
let React;
let ReactDOMClient;
let act;
let assertConsoleErrorDev;
beforeEach(() => {
jest.resetModules();
React = require('react');
ReactDOMClient = require('react-dom/client');
act = require('internal-test-utils').act;
assertConsoleErrorDev =
require('internal-test-utils').assertConsoleErrorDev;
});
describe('reconciliation', () => {
it('should update children when possible', async () => {
const container = document.createElement('div');
const root = ReactDOMClient.createRoot(container);
const mockMount = jest.fn();
const mockUpdate = jest.fn();
const mockUnmount = jest.fn();
class MockComponent extends React.Component {
componentDidMount = mockMount;
componentDidUpdate = mockUpdate;
componentWillUnmount = mockUnmount;
render() {
return <span />;
}
}
expect(mockMount).toHaveBeenCalledTimes(0);
expect(mockUpdate).toHaveBeenCalledTimes(0);
expect(mockUnmount).toHaveBeenCalledTimes(0);
await act(async () => {
root.render(
<div>
<MockComponent />
</div>,
);
});
expect(mockMount).toHaveBeenCalledTimes(1);
expect(mockUpdate).toHaveBeenCalledTimes(0);
expect(mockUnmount).toHaveBeenCalledTimes(0);
// ... (508 more lines)
Domain
Subdomains
Source
Frequently Asked Questions
What does ReactMultiChild-test.js do?
ReactMultiChild-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
Where is ReactMultiChild-test.js in the architecture?
ReactMultiChild-test.js is located at packages/react-dom/src/__tests__/ReactMultiChild-test.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-dom/src/__tests__).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free