2022-03-18 21:50:24 +00:00
|
|
|
import * as smartstring from '../ts/index.js';
|
2018-07-21 12:37:39 +00:00
|
|
|
import { tap, expect } from '@pushrocks/tapbundle';
|
2017-10-05 13:55:59 +00:00
|
|
|
|
|
|
|
// git
|
2018-07-21 12:37:39 +00:00
|
|
|
let testGit: smartstring.GitRepo;
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect create a new Git class GitRepo', async () => {
|
2018-07-21 12:37:39 +00:00
|
|
|
testGit = new smartstring.GitRepo('git+https://github.com/pushrocks/smartstring.git');
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit).toBeInstanceOf(smartstring.GitRepo);
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect return a .host', async () => {
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit.host).toEqual('github.com');
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect return a .user', async () => {
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit.user).toEqual('pushrocks');
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect return a .repo', async () => {
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit.repo).toEqual('smartstring');
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect return a .httpsUrl', async () => {
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit.httpsUrl).toEqual('https://github.com/pushrocks/smartstring.git');
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
tap.test('expect return a .sshUrl', async () => {
|
2022-03-18 21:50:24 +00:00
|
|
|
expect(testGit.sshUrl).toEqual('git@github.com:pushrocks/smartstring.git');
|
2018-07-21 12:37:39 +00:00
|
|
|
});
|
2017-10-05 13:55:59 +00:00
|
|
|
|
2018-07-21 12:37:39 +00:00
|
|
|
tap.start();
|