diff --git a/src/shared/utils/path.test.ts b/src/shared/utils/path.test.ts new file mode 100644 index 0000000000..ecdae38454 --- /dev/null +++ b/src/shared/utils/path.test.ts @@ -0,0 +1,28 @@ +import joinPaths from './path'; + +describe('Check path', () => { + //GIVEN + const tests = [ + { + name: 'empty path', + expected: '/', + arguments: [], + }, + { name: 'single argument', arguments: ['test'], expected: '/test' }, + { + name: 'more arguments', + arguments: ['test', 'busola', 'path'], + expected: '/test/busola/path', + }, + ]; + + tests.forEach(test => { + it(test.name, () => { + //WHEN + const result = joinPaths(...test.arguments); + + //THEN + expect(result).toEqual(test.expected); + }); + }); +});