1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/utils/commandToString.test.ts

20 lines
509 B
TypeScript
Raw Normal View History

2023-03-19 19:03:04 +02:00
import commandToString from './commandToString';
describe('commandToString', () => {
it('should convert a command array to a string', () => {
const testCases: [string, string[], string][] = [
['ls', ['-la'], 'ls -la'],
['docker', ['--profile', 'with spaces'], 'docker --profile "with spaces"'],
['', [], ''],
['', [''], ''],
];
for (const [commandName, args, expected] of testCases) {
const actual = commandToString(commandName, args);
expect(actual).toBe(expected);
}
});
});