use reflow to migrate from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-19 16:38:07 +02:00
parent f7b8050dfa
commit 6e7a08a3bb
495 changed files with 14239 additions and 13766 deletions

View File

@@ -0,0 +1,28 @@
import { createLink } from './FileTreeLeaf';
import { File } from '@scm-manager/ui-types';
describe('create link tests', () => {
function dir(path: string): File {
return {
name: 'dir',
path: path,
directory: true,
length: 1,
revision: '1a',
_links: {},
_embedded: {
children: [],
},
};
}
it('should create link', () => {
expect(createLink('src', dir('main'))).toBe('src/main/');
expect(createLink('src', dir('/main'))).toBe('src/main/');
expect(createLink('src', dir('/main/'))).toBe('src/main/');
});
it('should return base url if the directory path is empty', () => {
expect(createLink('src', dir(''))).toBe('src/');
});
});