Fix conflicts
This commit is contained in:
@@ -4,6 +4,9 @@ const IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== '
|
||||
const OPTIONS = {
|
||||
corePath: 'http://localhost:3000/node_modules/@ffmpeg/core/ffmpeg-core.js',
|
||||
};
|
||||
const FLAME_MP4_LENGTH = 100374;
|
||||
const META_FLAME_MP4_LENGTH = 100408;
|
||||
const META_FLAME_MP4_LENGTH_NO_SPACE = 100404;
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = {
|
||||
@@ -11,5 +14,8 @@ if (typeof module !== 'undefined') {
|
||||
BASE_URL,
|
||||
IS_BROWSER,
|
||||
OPTIONS,
|
||||
FLAME_MP4_LENGTH,
|
||||
META_FLAME_MP4_LENGTH,
|
||||
META_FLAME_MP4_LENGTH_NO_SPACE,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,3 +25,38 @@ describe('transcode()', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('run()', () => {
|
||||
describe('should run a command with quoted parameters at start no spaces', () => {
|
||||
['flame.avi'].forEach((name) => (
|
||||
it(`run ${name}`, async () => {
|
||||
await ffmpeg.write(name, `${BASE_URL}/${name}`);
|
||||
await ffmpeg.run(`-y -i ${name} -metadata 'title="test"' output.mp4`);
|
||||
const data = ffmpeg.read('output.mp4');
|
||||
expect(data.length).to.be(META_FLAME_MP4_LENGTH_NO_SPACE);
|
||||
}).timeout(TIMEOUT)
|
||||
));
|
||||
});
|
||||
|
||||
describe('should run a command with quoted parameters at start and a space in between', () => {
|
||||
['flame.avi'].forEach((name) => (
|
||||
it(`run ${name}`, async () => {
|
||||
await ffmpeg.write(name, `${BASE_URL}/${name}`);
|
||||
await ffmpeg.run(`-y -i ${name} -metadata 'title="my title"' output.mp4`);
|
||||
const data = ffmpeg.read('output.mp4');
|
||||
expect(data.length).to.be(META_FLAME_MP4_LENGTH);
|
||||
}).timeout(TIMEOUT)
|
||||
));
|
||||
});
|
||||
|
||||
describe('should run a command with name quoted parameters and a space in between', () => {
|
||||
['flame.avi'].forEach((name) => (
|
||||
it(`run ${name}`, async () => {
|
||||
await ffmpeg.write(name, `${BASE_URL}/${name}`);
|
||||
await ffmpeg.run(`-y -i ${name} -metadata title="my title" output.mp4`);
|
||||
const data = ffmpeg.read('output.mp4');
|
||||
expect(data.length).to.be(META_FLAME_MP4_LENGTH);
|
||||
}).timeout(TIMEOUT)
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user