Skip to content

Commit c92f026

Browse files
committed
add test back
1 parent eb4460d commit c92f026

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

__tests__/concat.test.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import { describe, it, jest } from '@jest/globals';
2+
import path from 'node:path';
3+
import os from 'node:os';
4+
import { concat } from '../src/ffmpeg-concat.js';
25

3-
// const isMac = os.platform() === 'darwin';
4-
// const getFile = (file: string) => path.join(process.cwd(), file);
5-
// const output = isMac ? 'example_mac.mp4' : 'example_linux.mp4';
6+
const isMac = os.platform() === 'darwin';
7+
const getFile = (file: string) => path.join(process.cwd(), file);
8+
const output = isMac ? 'example_mac.mp4' : 'example_linux.mp4';
69

710
describe('concat function', () => {
811
it(
912
'should concatenate videos successfully',
10-
() => {
13+
async () => {
1114
const mockEnsureDirSync = jest.fn();
1215
// const mockInitFrames = jest.fn(() => Promise.resolve({ frames: [], scenes: [], theme: {} }));
1316
// const mockRenderFrames = jest.fn(() => Promise.resolve('framePattern'));
@@ -31,11 +34,11 @@ describe('concat function', () => {
3134
// transcodeVideo: mockTranscodeVideo,
3235
// }));
3336

34-
// await concat({
35-
// videos: [getFile('media/0.mp4'), getFile('media/0a.mp4'), getFile('media/1.mp4'), getFile('media/2.mp4')],
36-
// output: path.join('media', output),
37-
// transition: { name: 'directionalwipe', duration: 500, params: {} },
38-
// });
37+
await concat({
38+
videos: [getFile('media/0.mp4'), getFile('media/0a.mp4'), getFile('media/1.mp4'), getFile('media/2.mp4')],
39+
output: path.join('media', output),
40+
transition: { name: 'directionalwipe', duration: 500, params: {} },
41+
});
3942

4043
// Perform assertions to ensure mock functions were called as expected
4144
// expect(mockInitFrames).toHaveBeenCalled();

0 commit comments

Comments
 (0)