From 85fe53a9e289ea3166ea0b0afa958a6d524a7a1d Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 21 Nov 2022 03:39:40 -0800 Subject: [PATCH] Run date formatter test on unix only Summary: The test added in D41342194 (https://github.com/facebook/flipper/commit/f1cbe7ed79f50f522552055f706f3ea7a835e74f) fails on Windows: https://github.com/facebook/flipper/actions/runs/3489945702/jobs/5840723948 Turns out this is a known issue: https://github.com/facebook/flipper/blob/1adcf2bc68acf137c41d99c967012b5dfc80dff5/desktop/flipper-plugin-core/src/utils/__tests__/shallowSerialization.node.tsx#L228 So, following the advice there and running it on unix only. Reviewed By: lawrencelomax Differential Revision: D41403510 fbshipit-source-id: e08ce4be58adf0547bffec50850c7c259b4e33d5 --- .../src/ui/__tests__/DataFormatter.node.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/desktop/flipper-plugin/src/ui/__tests__/DataFormatter.node.tsx b/desktop/flipper-plugin/src/ui/__tests__/DataFormatter.node.tsx index 97f57f229..cf39436f6 100644 --- a/desktop/flipper-plugin/src/ui/__tests__/DataFormatter.node.tsx +++ b/desktop/flipper-plugin/src/ui/__tests__/DataFormatter.node.tsx @@ -21,9 +21,6 @@ test('default formatter', () => { expect( DataFormatter.format(new Date(2020, 2, 3, 5, 8, 4, 244654)), ).toMatchInlineSnapshot(`"05:12:08.654"`); - expect( - DataFormatter.format(new Date(1668609938.068577 * 1000)), - ).toMatchInlineSnapshot(`"01:45:38.068"`); expect(DataFormatter.format('test')).toMatchInlineSnapshot(`"test"`); expect(DataFormatter.format({hello: 'world'})).toMatchInlineSnapshot(` @@ -74,6 +71,13 @@ test('default formatter', () => { `); }); +test.unix('date formatter', () => { + // dates on windows don't support changed timezones + expect( + DataFormatter.format(new Date(1668609938.068577 * 1000)), + ).toMatchInlineSnapshot(`"01:45:38.068"`); +}); + test('linkify formatter', () => { const linkify = (value: any) => DataFormatter.format(value, DataFormatter.linkify);