mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
015ff2ed66
This was causing a slowdown in one of the tests ESLintRuleExhaustiveDeps-test.js. Reverting until we figure out why.
36 lines
833 B
JavaScript
36 lines
833 B
JavaScript
/**
|
|
* 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 ReactNoopServer;
|
|
|
|
describe('ReactServer', () => {
|
|
beforeEach(() => {
|
|
jest.resetModules();
|
|
|
|
React = require('react');
|
|
ReactNoopServer = require('react-noop-renderer/server');
|
|
});
|
|
|
|
function div(...children) {
|
|
children = children.map(c =>
|
|
typeof c === 'string' ? {text: c, hidden: false} : c,
|
|
);
|
|
return {type: 'div', children, prop: undefined, hidden: false};
|
|
}
|
|
|
|
it('can call render', () => {
|
|
const result = ReactNoopServer.render(<div>hello world</div>);
|
|
expect(result.root).toEqual(div('hello world'));
|
|
});
|
|
});
|