Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbadura committed Aug 28, 2024
1 parent b2ef741 commit 0f1414a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/shared/utils/path.test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
});

0 comments on commit 0f1414a

Please sign in to comment.