Skip to content

🎥 Make videos programmatically with React

add a test

Jonny Burgerb58cfcf4bc8f
diff --git a/packages/webcodecs/src/test/correct-byte-length.test.ts b/packages/webcodecs/src/test/correct-byte-length.test.ts
new file mode 100644
index 0000000000..82fd4c81cc
--- /dev/null
+++ b/packages/webcodecs/src/test/correct-byte-length.test.ts
@@ -0,0 +1,23 @@
+import {expect, test} from 'bun:test';
+import {makeMatroskaBytes} from '../create/matroska/matroska-utils';
+
+test('should serialize with correct byte length', () => {
+ const withInheritedWidth = makeMatroskaBytes({
+ type: 'Timestamp',
+ minVintWidth: null,
+ value: {
+ value: 0,
+ byteLength: null,
+ },
+ });
+
+ const withFixedWidth = makeMatroskaBytes({
+ type: 'Timestamp',
+ minVintWidth: null,
+ value: {
+ value: 0,
+ byteLength: 1,
+ },
+ });
+ expect(withFixedWidth.bytes).toEqual(withInheritedWidth.bytes);
+});