1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @emails react-core
    
  8.  * @jest-environment node
    
  9.  */
    
  10. 
    
  11. 'use strict';
    
  12. 
    
  13. let React;
    
  14. let ReactNoopServer;
    
  15. 
    
  16. describe('ReactServer', () => {
    
  17.   beforeEach(() => {
    
  18.     jest.resetModules();
    
  19. 
    
  20.     React = require('react');
    
  21.     ReactNoopServer = require('react-noop-renderer/server');
    
  22.   });
    
  23. 
    
  24.   function div(...children) {
    
  25.     children = children.map(c =>
    
  26.       typeof c === 'string' ? {text: c, hidden: false} : c,
    
  27.     );
    
  28.     return {type: 'div', children, prop: undefined, hidden: false};
    
  29.   }
    
  30. 
    
  31.   it('can call render', () => {
    
  32.     const result = ReactNoopServer.render(<div>hello world</div>);
    
  33.     expect(result.root).toEqual(div('hello world'));
    
  34.   });
    
  35. });