add tests

This commit is contained in:
OpportunityLiu
2020-03-20 22:14:58 +08:00
Unverified
parent 7d75884a86
commit be19756845
15 changed files with 3508 additions and 41 deletions
+14
View File
@@ -0,0 +1,14 @@
import * as git from './git';
import * as semver from 'semver';
describe('lsRemote', () => {
it('should return correct records', async () => {
const records = await git.lsRemote();
expect(Object.keys(records).length).not.toBeLessThan(10);
for (const tag in records) {
const ref = records[tag];
expect(semver.parse(tag)).toBeInstanceOf(semver.SemVer);
expect(ref).toMatch(/^[0-9a-f]{40}$/gi);
}
}, 100000);
});