@@ -171,32 +171,56 @@ describe("isValidVideo", () => {
171
171
expect ( result1 ) . toBe ( false ) ;
172
172
} ) ;
173
173
174
- test ( ' validateMp4 should return true for specific byte sequence' , ( ) => {
174
+ test ( " validateMp4 should return true for specific byte sequence" , ( ) => {
175
175
const fileBuffer = Buffer . from ( [
176
- 0x00 , 0x00 , 0x00 , 0x18 , // First 4 bytes
177
- 0x66 , 0x74 , 0x79 , 0x70 // Next 4 bytes
176
+ 0x00 ,
177
+ 0x00 ,
178
+ 0x00 ,
179
+ 0x18 , // First 4 bytes
180
+ 0x66 ,
181
+ 0x74 ,
182
+ 0x79 ,
183
+ 0x70 , // Next 4 bytes
178
184
] ) ;
179
185
180
186
const result = isValidVideo ( fileBuffer ) ;
181
187
expect ( result ) . toBe ( true ) ;
182
188
} ) ;
183
189
184
- test ( ' validateMp4 should return true for byte sequence 1' , ( ) => {
190
+ test ( " validateMp4 should return true for byte sequence 1" , ( ) => {
185
191
const fileBuffer = Buffer . from ( [
186
- 0x00 , 0x00 , 0x00 , 0x20 , // First 4 bytes
187
- 0x66 , 0x74 , 0x79 , 0x70 , // Next 4 bytes
188
- 0x6d , 0x70 , 0x34 , 0x32 // Last 4 bytes
192
+ 0x00 ,
193
+ 0x00 ,
194
+ 0x00 ,
195
+ 0x20 , // First 4 bytes
196
+ 0x66 ,
197
+ 0x74 ,
198
+ 0x79 ,
199
+ 0x70 , // Next 4 bytes
200
+ 0x6d ,
201
+ 0x70 ,
202
+ 0x34 ,
203
+ 0x32 , // Last 4 bytes
189
204
] ) ;
190
205
191
206
const result = isValidVideo ( fileBuffer ) ;
192
207
expect ( result ) . toBe ( true ) ;
193
208
} ) ;
194
209
195
- test ( ' validateMp4 should return true for byte sequence 2' , ( ) => {
210
+ test ( " validateMp4 should return true for byte sequence 2" , ( ) => {
196
211
const fileBuffer = Buffer . from ( [
197
- 0x00 , 0x00 , 0x00 , 0x1c , // First 4 bytes
198
- 0x66 , 0x74 , 0x79 , 0x70 , // Next 4 bytes
199
- 0x69 , 0x73 , 0x6f , 0x6d // Last 4 bytes
212
+ 0x00 ,
213
+ 0x00 ,
214
+ 0x00 ,
215
+ 0x1c , // First 4 bytes
216
+ 0x66 ,
217
+ 0x74 ,
218
+ 0x79 ,
219
+ 0x70 , // Next 4 bytes
220
+ 0x69 ,
221
+ 0x73 ,
222
+ 0x6f ,
223
+ 0x6d , // Last 4 bytes
200
224
] ) ;
201
225
202
226
const result = isValidVideo ( fileBuffer ) ;
0 commit comments