Skip to content

🎥 Make videos programmatically with React

add test

Jonny Burger220f9d6aeb49
diff --git a/packages/media-parser/src/test/parse-avi-file.test.ts b/packages/media-parser/src/test/parse-avi-file.test.ts
index 4cf5bc4e66..3fa9495439 100644
--- a/packages/media-parser/src/test/parse-avi-file.test.ts
+++ b/packages/media-parser/src/test/parse-avi-file.test.ts
@@ -42,7 +42,12 @@ test('AVI file', async () => {
},
onAudioTrack: () => {
audioTrackCount++;
- return () => {
+ return (sample) => {
+ const time = sample.timestamp / sample.timescale;
+ if (time > 31) {
+ throw new Error('time higher than duration');
+ }
+
audioSamples++;
};
},
@@ -52,7 +57,12 @@ test('AVI file', async () => {
}
videoTrackCount++;
- return () => {
+ return (sample) => {
+ const time = sample.timestamp / sample.timescale;
+ if (time > 31) {
+ throw new Error('time higher than duration');
+ }
+
videoSamples++;
};
},