| 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 | */ |
| 9 | |
| 10 | 'use strict'; |
| 11 | |
| 12 | describe('ReactDOMFrameScheduling', () => { |
| 13 | beforeEach(() => { |
| 14 | jest.resetModules(); |
| 15 | |
| 16 | jest.unmock('scheduler'); |
| 17 | }); |
| 18 | |
| 19 | // We're just testing importing, not using it. |
| 20 | // It is important because even isomorphic components may import it. |
| 21 | it('can import findDOMNode in Node environment', () => { |
| 22 | const prevWindow = global.window; |
| 23 | try { |
| 24 | // Simulate the Node environment: |
| 25 | delete global.window; |
| 26 | jest.resetModules(); |
| 27 | expect(() => { |
| 28 | require('react-dom'); |
| 29 | }).not.toThrow(); |
| 30 | } finally { |
| 31 | global.window = prevWindow; |
| 32 | } |
| 33 | }); |
| 34 | }); |