ReactServerRendering-test.js — react Source File
Architecture documentation for ReactServerRendering-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
* @jest-environment node
*/
'use strict';
let React;
let ReactDOMServer;
let PropTypes;
let ReactSharedInternals;
let assertConsoleErrorDev;
describe('ReactDOMServer', () => {
beforeEach(() => {
jest.resetModules();
React = require('react');
PropTypes = require('prop-types');
ReactDOMServer = require('react-dom/server');
assertConsoleErrorDev =
require('internal-test-utils').assertConsoleErrorDev;
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
});
describe('renderToString', () => {
it('should generate simple markup', () => {
const response = ReactDOMServer.renderToString(<span>hello world</span>);
expect(response).toMatch(new RegExp('<span' + '>hello world</span>'));
});
it('should generate simple markup for self-closing tags', () => {
const response = ReactDOMServer.renderToString(<img />);
expect(response).toMatch(new RegExp('<img' + '/>'));
});
it('should generate comment markup for component returns null', () => {
class NullComponent extends React.Component {
render() {
return null;
}
}
const response = ReactDOMServer.renderToString(<NullComponent />);
expect(response).toBe('');
});
// TODO: Test that listeners are not registered onto any document/container.
it('should render composite components', () => {
class Parent extends React.Component {
render() {
return (
<div>
<Child name="child" />
// ... (1015 more lines)
Domain
Subdomains
Classes
Source
Frequently Asked Questions
What does ReactServerRendering-test.js do?
ReactServerRendering-test.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
Where is ReactServerRendering-test.js in the architecture?
ReactServerRendering-test.js is located at packages/react-dom/src/__tests__/ReactServerRendering-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