🎥 Make videos programmatically with React
fix test
Jonny Burger8432dbb800bb
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsxindex 864234805b..b6c86fba84 100644--- a/packages/example/src/Root.tsx+++ b/packages/example/src/Root.tsx@@ -98,6 +98,8 @@ if (alias !== 'alias') {throw new Error('should support TS aliases');}+const INCLUDE_COMP_BREAKING_GET_COMPOSITIONS = false;+// @ts-expect-error no typesimport styles from './styles.module.scss';@@ -450,31 +452,33 @@ export const Index: React.FC = () => {height={720}/></MyCtx.Provider>- <Composition- id="circular-structure"- component={Framer}- width={1080}- height={1080}- durationInFrames={30}- fps={30}- calculateMetadata={() => {- const objectA = {- name: 'Object A',- };+ {INCLUDE_COMP_BREAKING_GET_COMPOSITIONS ? (+ <Composition+ id="circular-structure"+ component={Framer}+ width={1080}+ height={1080}+ durationInFrames={30}+ fps={30}+ calculateMetadata={() => {+ const objectA = {+ name: 'Object A',+ };- const objectB = {- name: 'Object B',- linkedObject: objectA, // ObjectB links to objectA- };+ const objectB = {+ name: 'Object B',+ linkedObject: objectA, // ObjectB links to objectA+ };- // @ts-expect-error linked object- objectA.linkedObject = objectB;+ // @ts-expect-error linked object+ objectA.linkedObject = objectB;- return {- props: objectA,- };- }}- />+ return {+ props: objectA,+ };+ }}+ />+ ) : null}<Compositionid="class-serialization"component={ClassSerialization}diff --git a/packages/example/src/test/stills-and-colorspaces.test.ts b/packages/example/src/test/stills-and-colorspaces.test.tsindex 2c83df5bc0..8e58792f90 100644--- a/packages/example/src/test/stills-and-colorspaces.test.ts+++ b/packages/example/src/test/stills-and-colorspaces.test.ts@@ -1,6 +1,5 @@import {bundle} from '@remotion/bundler';import {- getCompositions,RenderInternals,renderMedia,renderStill,@@ -11,7 +10,6 @@ import {execSync} from 'node:child_process';import {existsSync, readFileSync, unlinkSync, writeFileSync} from 'node:fs';import {tmpdir} from 'node:os';import path from 'node:path';-import {VideoConfig} from 'remotion';import sharp from 'sharp';import {afterAll, beforeAll, expect, test} from 'vitest';// @ts-expect-error it does work@@ -33,11 +31,11 @@ afterAll(() => {test('Can render a still png using Node.JS APIs',async () => {- const compositions = await getCompositions(bundled);-- const composition = compositions.find(- (c) => c.id === 'react-svg',- ) as VideoConfig;+ const composition = await selectComposition({+ serveUrl: bundled,+ id: 'react-svg',+ inputProps: {},+ });const folder = path.join(tmpdir(), 'remotion-test', 'render-still');const testOut = path.join(folder, 'still.png');