Skip to content

🎥 Make videos programmatically with React

add test and remove unused files

Shankhadeep Dey3033bb0615be
diff --git a/packages/example/out.mp4 b/packages/example/out.mp4
new file mode 100644
index 0000000000..0b9ce75bc8
Binary files /dev/null and b/packages/example/out.mp4 differ
diff --git a/packages/example/src/ts-entry.tsx b/packages/example/src/ts-entry.tsx
new file mode 100644
index 0000000000..690fbfc5bf
--- /dev/null
+++ b/packages/example/src/ts-entry.tsx
@@ -0,0 +1,4 @@
+import {registerRoot} from 'remotion';
+import {Index} from './video-ts';
+
+registerRoot(Index);
diff --git a/packages/example/src/video-ts.tsx b/packages/example/src/video-ts.tsx
new file mode 100644
index 0000000000..7bdaf251e3
--- /dev/null
+++ b/packages/example/src/video-ts.tsx
@@ -0,0 +1,17 @@
+import {Composition} from 'remotion';
+import {Framer} from './Framer';
+
+export const Index = () => {
+ return (
+ <>
+ <Composition
+ id="framer"
+ component={Framer}
+ width={1080}
+ height={1080}
+ fps={30}
+ durationInFrames={100}
+ />
+ </>
+ );
+};
diff --git a/packages/example/wow.ts b/packages/example/wow.ts
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/tests/rendering.test.ts b/tests/rendering.test.ts
index b1dd9acef8..2caa34c4e3 100644
--- a/tests/rendering.test.ts
+++ b/tests/rendering.test.ts
@@ -1,6 +1,7 @@
import execa from "execa";
import fs from "fs";
import path from "path";
+import { complexSubtract } from "../packages/media-utils/dist/fft/complex";
const outputPath = path.join(process.cwd(), "packages/example/out.mp4");
@@ -311,3 +312,40 @@ test("Dynamic duration should work", async () => {
fs.unlinkSync(outputPath);
}
});
+
+test("Should be able to render if remotion.config.js is not provided", async () => {
+ const task = await execa(
+ "node",
+ [
+ "packages/cli/remotion-cli.js",
+ "render",
+ "packages/example/src/entry.jsx",
+ "framer",
+ outputPath,
+ ],
+ {
+ reject: false,
+ }
+ );
+
+ expect(task.exitCode).toBe(0);
+});
+
+test("Should be able to render if remotion.config.ts is not provided", async () => {
+ const task = await execa(
+ "node",
+ [
+ "packages/cli/remotion-cli.js",
+ "render",
+ "packages/example/src/ts-entry.tsx",
+ "framer",
+ outputPath,
+ ],
+ {
+ reject: false,
+ }
+ );
+ console.log(task.stderr,'err');
+
+ expect(task.exitCode).toBe(0);
+});