Skip to content

🎥 Make videos programmatically with React

fix more tests

Jonny Burgerd9acf8d957d6
diff --git a/packages/it-tests/src/rendering/base64-audio.test.ts b/packages/it-tests/src/rendering/base64-audio.test.ts
index 9596782761..31a6591949 100644
--- a/packages/it-tests/src/rendering/base64-audio.test.ts
+++ b/packages/it-tests/src/rendering/base64-audio.test.ts
@@ -12,32 +12,36 @@ beforeEach(() => {
}
});
-test("Should be able to render a MP3 audio file", async () => {
- const task = execa(
- "pnpm",
- ["exec", "remotion", "render", "audio-testing-base64", outputPath],
- {
- cwd: path.join(process.cwd(), "..", "example"),
- }
- );
- task.stderr?.pipe(process.stderr);
- await task;
- const exists = fs.existsSync(outputPath);
- expect(exists).toBe(true);
+test(
+ "Should be able to render a MP3 audio file",
+ async () => {
+ const task = execa(
+ "pnpm",
+ ["exec", "remotion", "render", "audio-testing-base64", outputPath],
+ {
+ cwd: path.join(process.cwd(), "..", "example"),
+ }
+ );
+ task.stderr?.pipe(process.stderr);
+ await task;
+ const exists = fs.existsSync(outputPath);
+ expect(exists).toBe(true);
- const info = await RenderInternals.callFf({
- bin: "ffprobe",
- args: [outputPath],
- indent: false,
- logLevel: "info",
- binariesDirectory: null,
- cancelSignal: undefined,
- });
- const data = info.stderr;
- expect(data).toContain("mp3");
- expect(data).toContain("stereo");
- expect(data).toContain("320 kb/s");
- expect(data).toContain("Stream #0");
- expect(data).not.toContain("Stream #1");
- fs.unlinkSync(outputPath);
-});
+ const info = await RenderInternals.callFf({
+ bin: "ffprobe",
+ args: [outputPath],
+ indent: false,
+ logLevel: "info",
+ binariesDirectory: null,
+ cancelSignal: undefined,
+ });
+ const data = info.stderr;
+ expect(data).toContain("mp3");
+ expect(data).toContain("stereo");
+ expect(data).toContain("320 kb/s");
+ expect(data).toContain("Stream #0");
+ expect(data).not.toContain("Stream #1");
+ fs.unlinkSync(outputPath);
+ },
+ { timeout: 30000 }
+);
diff --git a/packages/it-tests/src/rendering/bundle-renderer.test.ts b/packages/it-tests/src/rendering/bundle-renderer.test.ts
index 8edff39315..f04325fbce 100644
--- a/packages/it-tests/src/rendering/bundle-renderer.test.ts
+++ b/packages/it-tests/src/rendering/bundle-renderer.test.ts
@@ -16,7 +16,9 @@ test("Should be able to bundle the renderer", () => {
target: "node16",
bundle: true,
outfile,
- entryPoints: [`${__dirname}/test-index.ts`],
+ entryPoints: [
+ `${__dirname}${path.sep}..${path.sep}..${path.sep}test-index.ts`,
+ ],
});
expect(errors.length).toBe(0);
expect(warnings.length).toBe(0);
diff --git a/packages/it-tests/src/rendering/compositions.test.ts b/packages/it-tests/src/rendering/compositions.test.ts
deleted file mode 100644
index 40600629fd..0000000000
--- a/packages/it-tests/src/rendering/compositions.test.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import path from "path";
-import execa from "execa";
-import { expect, test } from "bun:test";
-
-test("Should be able to call pnpm exec compositions", async () => {
- const task = await execa(
- "pnpm",
- ["exec", "remotion", "compositions", "src/index.ts"],
- {
- cwd: path.join(process.cwd(), "..", "example"),
- }
- );
-
- expect(task.stdout).toContain("The following compositions");
-});
diff --git a/packages/it-tests/src/rendering/rendering.test.ts b/packages/it-tests/src/rendering/rendering.test.ts
index 78e111450f..b408a420b5 100644
--- a/packages/it-tests/src/rendering/rendering.test.ts
+++ b/packages/it-tests/src/rendering/rendering.test.ts
@@ -265,37 +265,41 @@ test("Should be able to render a WAV audio file", async () => {
fs.unlinkSync(out);
});
-test("Should be able to render a MP3 audio file", async () => {
- const out = outputPath.replace("mp4", "mp3");
- const task = execa(
- "pnpm",
- ["exec", "remotion", "render", "build", "audio-testing", out],
- {
- cwd: path.join(process.cwd(), "..", "example"),
- }
- );
- task.stderr?.pipe(process.stderr);
- await task;
- const exists = fs.existsSync(out);
- expect(exists).toBe(true);
+test(
+ "Should be able to render a MP3 audio file",
+ async () => {
+ const out = outputPath.replace("mp4", "mp3");
+ const task = execa(
+ "pnpm",
+ ["exec", "remotion", "render", "build", "audio-testing", out],
+ {
+ cwd: path.join(process.cwd(), "..", "example"),
+ }
+ );
+ task.stderr?.pipe(process.stderr);
+ await task;
+ const exists = fs.existsSync(out);
+ expect(exists).toBe(true);
- const info = await RenderInternals.callFf({
- bin: "ffprobe",
- args: [out],
- indent: false,
- logLevel: "info",
- binariesDirectory: null,
- cancelSignal: undefined,
- });
- const data = info.stderr;
- expect(data).toContain("mp3");
- expect(data).toContain("stereo");
- expect(data).toContain("Kevin MacLeod");
- expect(data).toContain("320 kb/s");
- expect(data).toContain("Stream #0");
- expect(data).not.toContain("Stream #1");
- fs.unlinkSync(out);
-});
+ const info = await RenderInternals.callFf({
+ bin: "ffprobe",
+ args: [out],
+ indent: false,
+ logLevel: "info",
+ binariesDirectory: null,
+ cancelSignal: undefined,
+ });
+ const data = info.stderr;
+ expect(data).toContain("mp3");
+ expect(data).toContain("stereo");
+ expect(data).toContain("Kevin MacLeod");
+ expect(data).toContain("320 kb/s");
+ expect(data).toContain("Stream #0");
+ expect(data).not.toContain("Stream #1");
+ fs.unlinkSync(out);
+ },
+ { timeout: 30000 }
+);
test("Should be able to render a AAC audio file", async () => {
const out = outputPath.replace("mp4", "aac");
@@ -590,3 +594,22 @@ test(
timeout: 30000,
}
);
+
+test(
+ "Should be able to call pnpm exec compositions",
+ async () => {
+ const task = await execa(
+ "pnpm",
+ ["exec", "remotion", "compositions", "build"],
+ {
+ cwd: path.join(process.cwd(), "..", "example"),
+ reject: false,
+ }
+ );
+
+ expect(task.stdout).toContain("The following compositions");
+ },
+ {
+ timeout: 30000,
+ }
+);
diff --git a/packages/it-tests/src/rendering/test-index.ts b/packages/it-tests/test-index.ts
similarity index 100%
rename from packages/it-tests/src/rendering/test-index.ts
rename to packages/it-tests/test-index.ts
diff --git a/turbo.json b/turbo.json
index b03993b5f1..b7ed69fd65 100644
--- a/turbo.json
+++ b/turbo.json
@@ -28,16 +28,13 @@
"dependsOn": ["^build", "build"],
"outputs": []
},
- "@remotion/example#test": {
- "dependsOn": ["^build", "build", "@remotion/it-tests#test"],
- "outputs": []
- },
+
"@remotion/renderer#test": {
"dependsOn": [
"^build",
"build",
"@remotion/lambda#build",
- "@remotion/example#test",
+ "@remotion/it-tests#test",
"@remotion/cloudrun#build"
],
"outputs": []