Disable all the measure* tests on Windows as they're flaky (#37264)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37264

Instead of disabling one test at a time, I've suppressed all the measure* related tests on Windows
with the hope to make the Windows CI less flaky.

Changelog:
[Internal] [Changed] - Disable all the measure* tests on Windows as they're flaky

Reviewed By: cipolleschi

Differential Revision: D45601448

fbshipit-source-id: 010905e1dbebd9c9da9d6710ea6ca0b99c4a2d5f
This commit is contained in:
Nicola Corti 2023-05-05 03:37:01 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 615d9aefc4
Коммит a3b57f6cb0
1 изменённых файлов: 63 добавлений и 51 удалений

Просмотреть файл

@ -157,7 +157,7 @@ async function mockRenderKeys(
});
describe('measure', () => {
test('component.measure(...) invokes callback', async () => {
itif(!isWindows)('component.measure(...) invokes callback', async () => {
const result = await mockRenderKeys([['foo']]);
const fooRef = nullthrows(result?.[0]?.[0]);
@ -170,7 +170,7 @@ async function mockRenderKeys(
expect(callback.mock.calls).toEqual([[10, 10, 100, 100, 0, 0]]);
});
test('unmounted.measure(...) does nothing', async () => {
itif(!isWindows)('unmounted.measure(...) does nothing', async () => {
const result = await mockRenderKeys([['foo'], null]);
const fooRef = nullthrows(result?.[0]?.[0]);
const callback = jest.fn();
@ -184,7 +184,9 @@ async function mockRenderKeys(
});
describe('measureInWindow', () => {
it('component.measureInWindow(...) invokes callback', async () => {
itif(!isWindows)(
'component.measureInWindow(...) invokes callback',
async () => {
const result = await mockRenderKeys([['foo']]);
const fooRef = nullthrows(result?.[0]?.[0]);
@ -195,7 +197,8 @@ async function mockRenderKeys(
nullthrows(FabricUIManager.getFabricUIManager()).measureInWindow,
).toHaveBeenCalledTimes(1);
expect(callback.mock.calls).toEqual([[10, 10, 100, 100]]);
});
},
);
itif(!isWindows)(
'unmounted.measureInWindow(...) does nothing',
@ -215,7 +218,9 @@ async function mockRenderKeys(
});
describe('measureLayout', () => {
it('component.measureLayout(component, ...) invokes callback', async () => {
itif(!isWindows)(
'component.measureLayout(component, ...) invokes callback',
async () => {
const result = await mockRenderKeys([['foo', 'bar']]);
const fooRef = nullthrows(result?.[0]?.[0]);
const barRef = nullthrows(result?.[0]?.[1]);
@ -228,9 +233,12 @@ async function mockRenderKeys(
nullthrows(FabricUIManager.getFabricUIManager()).measureLayout,
).toHaveBeenCalledTimes(1);
expect(successCallback.mock.calls).toEqual([[1, 1, 100, 100]]);
});
},
);
it('unmounted.measureLayout(component, ...) does nothing', async () => {
itif(!isWindows)(
'unmounted.measureLayout(component, ...) does nothing',
async () => {
const result = await mockRenderKeys([
['foo', 'bar'],
['foo', null],
@ -246,7 +254,8 @@ async function mockRenderKeys(
nullthrows(FabricUIManager.getFabricUIManager()).measureLayout,
).not.toHaveBeenCalled();
expect(successCallback).not.toHaveBeenCalled();
});
},
);
itif(!isWindows)(
'component.measureLayout(unmounted, ...) does nothing',
@ -269,7 +278,9 @@ async function mockRenderKeys(
},
);
it('unmounted.measureLayout(unmounted, ...) does nothing', async () => {
itif(!isWindows)(
'unmounted.measureLayout(unmounted, ...) does nothing',
async () => {
const result = await mockRenderKeys([['foo', 'bar'], null]);
const fooRef = nullthrows(result?.[0]?.[0]);
const barRef = nullthrows(result?.[0]?.[1]);
@ -282,7 +293,8 @@ async function mockRenderKeys(
nullthrows(FabricUIManager.getFabricUIManager()).measureLayout,
).not.toHaveBeenCalled();
expect(successCallback).not.toHaveBeenCalled();
});
},
);
});
});
});