From 90f4f59d0f416f4e21bcf8543bcf4011eb7bbfc5 Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Tue, 2 Apr 2019 01:19:14 +0800 Subject: [PATCH] perf(jest): fix .tsx jest tests for react-spring React Spring distributes ES6 by default, which breaks jest tests unless it's imported explicitly using the cjs extension. see https://github.com/react-spring/react-spring/issues/555 --- src/components/react_canvas/area_geometries.tsx | 2 +- src/components/react_canvas/bar_geometries.tsx | 2 +- src/components/react_canvas/line_geometries.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/react_canvas/area_geometries.tsx b/src/components/react_canvas/area_geometries.tsx index 41eea5dcbb..8586b89539 100644 --- a/src/components/react_canvas/area_geometries.tsx +++ b/src/components/react_canvas/area_geometries.tsx @@ -1,7 +1,7 @@ import { Group as KonvaGroup } from 'konva'; import React from 'react'; import { Circle, Group, Path } from 'react-konva'; -import { animated, Spring } from 'react-spring/renderprops-konva'; +import { animated, Spring } from 'react-spring/renderprops-konva.cjs'; import { LegendItem } from '../../lib/series/legend'; import { AreaGeometry, getGeometryStyle, PointGeometry } from '../../lib/series/rendering'; import { AreaSeriesStyle, SharedGeometryStyle } from '../../lib/themes/theme'; diff --git a/src/components/react_canvas/bar_geometries.tsx b/src/components/react_canvas/bar_geometries.tsx index 9b5085a44b..4dcac43202 100644 --- a/src/components/react_canvas/bar_geometries.tsx +++ b/src/components/react_canvas/bar_geometries.tsx @@ -1,7 +1,7 @@ import { Group as KonvaGroup } from 'konva'; import React from 'react'; import { Group, Rect } from 'react-konva'; -import { animated, Spring } from 'react-spring/renderprops-konva'; +import { animated, Spring } from 'react-spring/renderprops-konva.cjs'; import { LegendItem } from '../../lib/series/legend'; import { BarGeometry, getGeometryStyle } from '../../lib/series/rendering'; import { BarSeriesStyle, SharedGeometryStyle } from '../../lib/themes/theme'; diff --git a/src/components/react_canvas/line_geometries.tsx b/src/components/react_canvas/line_geometries.tsx index 7a4ac039ae..ce4fb4dddc 100644 --- a/src/components/react_canvas/line_geometries.tsx +++ b/src/components/react_canvas/line_geometries.tsx @@ -1,7 +1,7 @@ import { Group as KonvaGroup } from 'konva'; import React from 'react'; import { Circle, Group, Path } from 'react-konva'; -import { animated, Spring } from 'react-spring/renderprops-konva'; +import { animated, Spring } from 'react-spring/renderprops-konva.cjs'; import { LegendItem } from '../../lib/series/legend'; import { getGeometryStyle, LineGeometry, PointGeometry } from '../../lib/series/rendering'; import { LineSeriesStyle, SharedGeometryStyle } from '../../lib/themes/theme';