Skip to content

🎥 Make videos programmatically with React

tweak tests

Jonny Burger0684324cd3b7
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index e86be454a6..8a8b2d9100 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -14,4 +14,5 @@ jobs:
- run: npm i
- run: npx lerna bootstrap --ci
- run: npm run build
+ - run: npx lerna bootstrap --ci
- run: npm test
diff --git a/tests/hi.test.ts b/tests/rendering.test.ts
similarity index 58%
rename from tests/hi.test.ts
rename to tests/rendering.test.ts
index 9d418f4ad3..c4dea1bc49 100644
--- a/tests/hi.test.ts
+++ b/tests/rendering.test.ts
@@ -2,11 +2,15 @@ import execa from "execa";
import fs from "fs";
import path from "path";
-test("Should be able to render video", async () => {
- const outputPath = path.join(process.cwd(), "packages/example/out.mp4");
+const outputPath = path.join(process.cwd(), "packages/example/out.mp4");
+
+beforeEach(() => {
if (fs.existsSync(outputPath)) {
fs.unlinkSync(outputPath);
}
+});
+
+test("Should be able to render video", async () => {
const task = execa(
"npx",
[
@@ -34,3 +38,25 @@ test("Should be able to render video", async () => {
expect(data).toContain("1080x1920");
expect(data).toContain("30 fps");
});
+
+test("Should fail to render conflicting --sequence and --codec settings", async () => {
+ const task = await execa(
+ "npx",
+ [
+ "remotion",
+ "render",
+ "src/index.tsx",
+ "shadow-circles",
+ "--codec",
+ "h264",
+ "--sequence",
+ outputPath,
+ ],
+ {
+ cwd: "packages/example",
+ reject: false,
+ }
+ );
+ expect(task.exitCode).toBe(1);
+ expect(task.stderr).toContain("Detected both --codec");
+});