Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
setupFiles: ['./packages/react-native/jest/local-setup.js'],
fakeTimers: {
enableGlobally: true,
legacyFakeTimers: true,
legacyFakeTimers: false,
},
snapshotFormat: {
escapeString: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

'use strict';

// TODO(legacy-fake-timers): Fix these tests to work with modern timers.
jest.useFakeTimers({legacyFakeTimers: true});

jest.mock('react-native/Libraries/Utilities/HMRClient');

jest.mock('react-native/Libraries/Core/Devtools/getDevServer', () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,10 @@ describe('promise tasks', () => {
}
beforeEach(() => {
jest.resetModules();
jest.useFakeTimers({legacyFakeTimers: true});
InteractionManager = require('../InteractionManager');
sequenceId = 0;
});

afterEach(() => {
jest.useRealTimers();
});

it('should run a basic promise task', () => {
const task1 = jest.fn(() => {
expect(++sequenceId).toBe(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
*/

'use strict';

// TODO(legacy-fake-timers): Fix these tests to work with modern timers.
jest.useFakeTimers({legacyFakeTimers: true});

jest.mock('../../../Core/Devtools/parseErrorStack', () => {
return {__esModule: true, default: jest.fn(() => [])};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @oncall react_native
*/

// TODO(legacy-fake-timers): Fix these tests to work with modern timers.
jest.useFakeTimers({legacyFakeTimers: true});

import type {PressEvent} from '../../Types/CoreEventTypes';

const UIManager = require('../../ReactNative/UIManager');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @oncall react_native
*/

// TODO(legacy-fake-timers): Fix these tests to work with modern timers.
jest.useFakeTimers({legacyFakeTimers: true});

import type {HostComponent} from '../../../Renderer/shims/ReactNativeTypes';

import * as React from 'react';
Expand Down
4 changes: 0 additions & 4 deletions scripts/__tests__/publish-npm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ let consoleError;

describe('publish-npm', () => {
beforeAll(() => {
jest.useFakeTimers({legacyFakeTimers: false});
jest.setSystemTime(date);
});
afterAll(() => {
jest.useRealTimers();
});
beforeEach(() => {
consoleError = console.error;
console.error = consoleErrorMock;
Expand Down