Adding two tests for command parser.

* Test 1: quotes appear at start of command  and has a space in
* Test 2: quote appears in a command, and has a space.
This commit is contained in:
Paul Kinlan
2020-04-14 03:30:17 +01:00
parent b35eeba94c
commit 917880e1b7
4 changed files with 64 additions and 20 deletions

View File

@@ -18,3 +18,27 @@ describe('transcode()', () => {
));
});
});
describe('run()', () => {
describe('should run a command with quoted parameters at start and a space in between', () => {
['flame.avi'].forEach((name) => (
it(`run ${name}`, async () => {
await worker.write(name, `${BASE_URL}/${name}`);
await worker.run(`-y -i ${name} -metadata 'title="my title"' output.mp4`);
const { data } = await worker.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 worker.write(name, `${BASE_URL}/${name}`);
await worker.run(`-y -i ${name} -metadata title="my title" output.mp4`);
const { data } = await worker.read('output.mp4');
expect(data.length).to.be(META_FLAME_MP4_LENGTH);
}).timeout(TIMEOUT)
));
});
});