import { getGitUrl } from '../src/utils'; describe('canBeConvertToDate()', () => { test('empty string', () => { expect(getGitUrl('', '')).toBe(''); }); test('url domain with branch', () => { expect( getGitUrl('https://gitlink.org.cn/somunslotus/material-atom-predict.git', 'master'), ).toBe('https://gitlink.org.cn/somunslotus/material-atom-predict/tree/master'); }); test('url domain without branch', () => { expect(getGitUrl('https://gitlink.org.cn/somunslotus/material-atom-predict.git', '')).toBe( 'https://gitlink.org.cn/somunslotus/material-atom-predict.git', ); }); });