Skip to content

Commit

Permalink
test(av-cliper): use toBeCloseTo to compare duration
Browse files Browse the repository at this point in the history
  • Loading branch information
wendraw committed Nov 5, 2024
1 parent cee7495 commit 8eefac2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/av-cliper/src/__tests__/combinator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ test('Combinator ouput m4a', async () => {

const mp4Clip = new MP4Clip(com.output());
await mp4Clip.ready;
expect(mp4Clip.meta).toEqual({
duration: 1045333,
expect(mp4Clip.meta).toMatchObject({
width: 0,
height: 0,
audioSampleRate: defSampleRate,
audioChanCount: 2,
});
expect(mp4Clip.meta.duration / 1e6).toBeCloseTo(1, 1);
});

test('Combinator.output throw an error', async () => {
Expand Down Expand Up @@ -79,13 +79,13 @@ test('Combinator ouput exclude audio track', async () => {

const mp4Clip = new MP4Clip(com.output());
await mp4Clip.ready;
expect(mp4Clip.meta).toEqual({
duration: 1033323,
expect(mp4Clip.meta).toMatchObject({
width: 900,
height: 500,
audioSampleRate: 0,
audioChanCount: 0,
});
expect(mp4Clip.meta.duration / 1e6).toBeCloseTo(1, 1);
});

test('audio track buffer', () => {
Expand Down

0 comments on commit 8eefac2

Please sign in to comment.