Skip to content

🎥 Make videos programmatically with React

in tests for webkit, use `arraybuffer` output target

Igor Samokhovets46a9d006b37b
diff --git a/packages/web-renderer/src/test/artifact.test.tsx b/packages/web-renderer/src/test/artifact.test.tsx
index 8a20640afb..0c8cd9f894 100644
--- a/packages/web-renderer/src/test/artifact.test.tsx
+++ b/packages/web-renderer/src/test/artifact.test.tsx
@@ -38,7 +38,7 @@ test('should be able to render an artifact for still', async () => {
]);
});
-test('should fail to render multiple artifacts with the same filename', async () => {
+test('should fail to render multiple artifacts with the same filename', async (t) => {
const Component: React.FC = () => {
return <Artifact filename="test.txt" content="Hello World!" />;
};
@@ -58,6 +58,7 @@ test('should fail to render multiple artifacts with the same filename', async ()
onArtifact: (artifact) => {
artifacts.push(artifact);
},
+ outputTarget: t.task.file.projectName === 'webkit' ? 'buffer' : 'web-fs',
});
await expect(prom).rejects.toThrow(
'An artifact with output "test.txt" was already registered at frame 0, but now registered again at frame 1. Artifacts must have unique names. https://remotion.dev/docs/artifacts',
@@ -99,7 +100,7 @@ test('should be able to emit a thumbnail', async () => {
expect(content.slice(0, 8)).toEqual(pngSignature);
});
-test('should succeed to render multiple artifacts with renderMediaOnWeb()', async () => {
+test('should succeed to render multiple artifacts with renderMediaOnWeb()', async (t) => {
const Component: React.FC = () => {
const frame = useCurrentFrame();
return (
@@ -132,6 +133,7 @@ test('should succeed to render multiple artifacts with renderMediaOnWeb()', asyn
onArtifact: (artifact) => {
artifacts.push(artifact);
},
+ outputTarget: t.task.file.projectName === 'webkit' ? 'buffer' : 'web-fs',
});
expect(artifacts).toEqual([
diff --git a/packages/web-renderer/src/test/audio.test.tsx b/packages/web-renderer/src/test/audio.test.tsx
index b3c8ca6816..2dba19b6ea 100644
--- a/packages/web-renderer/src/test/audio.test.tsx
+++ b/packages/web-renderer/src/test/audio.test.tsx
@@ -6,7 +6,7 @@ import {renderMediaOnWeb} from '../render-media-on-web';
test(
'should not be able to set toneFrequency on web rendering',
{retry: 3},
- async () => {
+ async (t) => {
const Component: React.FC = () => {
return <Audio src={staticFile('dialogue.wav')} toneFrequency={0.5} />;
};
@@ -22,6 +22,8 @@ test(
durationInFrames: 1,
calculateMetadata: null,
},
+ outputTarget:
+ t.task.file.projectName === 'webkit' ? 'buffer' : 'web-fs',
});
throw new Error('Did resolve' + JSON.stringify(result));
}).rejects.toThrow(
@@ -58,5 +60,6 @@ test('should be able to render 2 audios', async (t) => {
},
frameRange: [0, 1],
logLevel: 'info',
+ outputTarget: t.task.file.projectName === 'webkit' ? 'buffer' : 'web-fs',
});
});
diff --git a/packages/web-renderer/src/test/frame-range.test.tsx b/packages/web-renderer/src/test/frame-range.test.tsx
index d7c79fdc6e..7a830ac996 100644
--- a/packages/web-renderer/src/test/frame-range.test.tsx
+++ b/packages/web-renderer/src/test/frame-range.test.tsx
@@ -2,7 +2,7 @@ import {expect, test} from 'vitest';
import type {RenderMediaOnWebProgress} from '../render-media-on-web';
import {renderMediaOnWeb} from '../render-media-on-web';
-test('should reject with invalid frame range', async () => {
+test('should reject with invalid frame range', async (t) => {
const Component: React.FC = () => {
return null;
};
@@ -18,6 +18,7 @@ test('should reject with invalid frame range', async () => {
},
inputProps: {},
frameRange: [-10, 50],
+ outputTarget: t.task.file.projectName === 'webkit' ? 'buffer' : 'web-fs',
});
await expect(prom).rejects.toThrow(
'The "durationInFrames" of the composition was evaluated to be 20, but frame range -10-50 is not inbetween 0-19',