smartgit/test/test.ts

30 lines
1.0 KiB
TypeScript
Raw Normal View History

2023-07-27 11:45:48 +00:00
import { tap, expect } from '@push.rocks/tapbundle';
2022-07-31 13:14:18 +00:00
import * as smartgit from '../ts/index.js';
2016-06-12 14:46:59 +00:00
2023-07-27 11:45:48 +00:00
import * as smartpath from '@push.rocks/smartpath';
2022-07-31 13:14:18 +00:00
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(
2023-07-27 11:45:48 +00:00
'https://gitlab.com/push.rocks/smartfile.git',
2022-07-31 13:18:04 +00:00
testRepoDirSmartfile
);
2020-08-15 13:46:56 +00:00
});
2019-06-20 12:10:42 +00:00
2023-11-15 14:15:18 +00:00
await tap.start();