smartstring/test/test.git.both.ts

27 lines
933 B
TypeScript
Raw Permalink Normal View History

2022-03-18 21:50:24 +00:00
import * as smartstring from '../ts/index.js';
import { tap, expect } from '@pushrocks/tapbundle';
2017-10-05 13:55:59 +00:00
// git
let testGit: smartstring.GitRepo;
2017-10-05 13:55:59 +00:00
tap.test('expect create a new Git class GitRepo', async () => {
testGit = new smartstring.GitRepo('git+https://github.com/pushrocks/smartstring.git');
2022-03-18 21:50:24 +00:00
expect(testGit).toBeInstanceOf(smartstring.GitRepo);
});
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');
});
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');
});
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');
});
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');
});
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');
});
2017-10-05 13:55:59 +00:00
tap.start();