/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/shared/__tests__/ReactDOMFrameScheduling-test.js
34 строки
823 B
Andrew Clark
Revert "[Tests] Reset modules by default" (#28318)
13 фев 2024, 19:39
Не верифицирован
13 фев 2024, 19:39
015ff2e
Код
Авторство
О чём код?
/** * 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('ReactDOMFrameScheduling', () => { beforeEach(() => { jest.resetModules(); jest.unmock('scheduler'); }); // We're just testing importing, not using it. // It is important because even isomorphic components may import it. it('can import findDOMNode in Node environment', () => { const prevWindow = global.window; try { // Simulate the Node environment: delete global.window; jest.resetModules(); expect(() => { require('react-dom'); }).not.toThrow(); } finally { global.window = prevWindow; } }); });