🎥 Make videos programmatically with React
`@remotion/web-renderer`: Fix lint error and increase test tolerances
Jonny Burger13e7e12768e7
diff --git a/packages/web-renderer/src/drawing/parse-linear-gradient.ts b/packages/web-renderer/src/drawing/parse-linear-gradient.tsindex d0bb673109..713205d882 100644--- a/packages/web-renderer/src/drawing/parse-linear-gradient.ts+++ b/packages/web-renderer/src/drawing/parse-linear-gradient.ts@@ -97,6 +97,23 @@ const isFullyTransparent = (color: string): boolean => {return rgba !== null && rgba.a === 0;};+const findNearestNonTransparent = (+ stops: ColorStop[],+ fromIndex: number,+ direction: -1 | 1,+): string | null => {+ let i = fromIndex + direction;+ while (i >= 0 && i < stops.length) {+ if (!isFullyTransparent(stops[i].color)) {+ return stops[i].color;+ }++ i += direction;+ }++ return null;+};+const resolveTransparentStops = (stops: ColorStop[]): void => {for (let i = 0; i < stops.length; i++) {if (!isFullyTransparent(stops[i].color)) {@@ -117,23 +134,6 @@ const resolveTransparentStops = (stops: ColorStop[]): void => {}};-const findNearestNonTransparent = (- stops: ColorStop[],- fromIndex: number,- direction: -1 | 1,-): string | null => {- let i = fromIndex + direction;- while (i >= 0 && i < stops.length) {- if (!isFullyTransparent(stops[i].color)) {- return stops[i].color;- }-- i += direction;- }-- return null;-};-const parseColorStops = (colorStopsStr: string): ColorStop[] | null => {// Split by comma, but respect parentheses in rgba(), rgb(), hsl(), hsla()const parts = colorStopsStr.split(/,(?![^(]*\))/);diff --git a/packages/web-renderer/src/test/background-clip.test.tsx b/packages/web-renderer/src/test/background-clip.test.tsxindex 269dcbb2a1..d0b7cd9a94 100644--- a/packages/web-renderer/src/test/background-clip.test.tsx+++ b/packages/web-renderer/src/test/background-clip.test.tsx@@ -37,6 +37,6 @@ test('should render background-clip: text (scaled)', async () => {blob,testId: 'background-clip-text-scaled',threshold: 0,- allowedMismatchedPixelRatio: 0.04,+ allowedMismatchedPixelRatio: 0.06,});});diff --git a/packages/web-renderer/src/test/text.test.tsx b/packages/web-renderer/src/test/text.test.tsxindex 529342142c..aba3aacc2a 100644--- a/packages/web-renderer/src/test/text.test.tsx+++ b/packages/web-renderer/src/test/text.test.tsx@@ -23,7 +23,7 @@ test('should render text', async (t) => {testId: 'text-fixture',threshold: 0,allowedMismatchedPixelRatio:- t.task.file.projectName === 'webkit' ? 0.09 : 0.001,+ t.task.file.projectName === 'webkit' ? 0.09 : 0.05,});});