smartgit/test/test.ts

30 lines
1022 B
TypeScript
Raw Normal View History

2019-06-18 13:17:50 +00:00
import { tap, expect } from '@pushrocks/tapbundle';
2022-07-31 13:14:18 +00:00
import * as smartgit from '../ts/index.js';
2016-06-12 14:46:59 +00:00
2022-07-31 13:14:18 +00:00
import * as smartpath from '@pushrocks/smartpath';
const __dirname = smartpath.get.dirnameFromImportMetaUrl(import.meta.url);
2019-06-20 12:10:42 +00:00
import * as path from 'path';
let testSmartgitInstance: smartgit.Smartgit;
2019-06-20 12:10:42 +00:00
const testRepoDir = path.join(__dirname, '../.nogit/testrepo');
2022-07-31 13:18:04 +00:00
const testRepoDirSmartfile = path.join(__dirname, '../.nogit/pushrocks_smartfile');
tap.test('should create a valid smartgit instance', async () => {
testSmartgitInstance = new smartgit.Smartgit();
await testSmartgitInstance.init();
2022-07-31 13:14:18 +00:00
expect(testSmartgitInstance).toBeInstanceOf(smartgit.Smartgit);
2022-07-31 13:18:04 +00:00
});
2019-06-20 12:10:42 +00:00
tap.test('should create a new repo at .nogit', async () => {
const gitRepo = await testSmartgitInstance.createRepoByOpen(testRepoDir);
});
tap.test('should clone a repo', async () => {
2022-07-31 13:18:04 +00:00
const gitRepo = await testSmartgitInstance.createRepoByClone(
'https://gitlab.com/pushrocks/smartfile.git',
testRepoDirSmartfile
);
2020-08-15 13:46:56 +00:00
});
2019-06-20 12:10:42 +00:00
2019-06-18 13:17:50 +00:00
tap.start();