Fixed naming

This commit is contained in:
Kasra Bigdeli
2020-02-23 21:18:21 -05:00
parent b1e3d49b4b
commit ccfceec4b5
2 changed files with 0 additions and 0 deletions

61
tests/GitHelper.test.ts Normal file
View File

@@ -0,0 +1,61 @@
import GitHelper from '../src/utils/GitHelper'
test('Testing - sanitizeRepoPathHttps', () => {
expect(
GitHelper.sanitizeRepoPathHttps(
' https://github.com/username/repository.git/ '
)
).toBe('github.com/username/repository.git')
})
test('Testing - sanitizeRepoPathHttps from SSH', () => {
expect(
GitHelper.sanitizeRepoPathHttps(
' git@github.com/username/repository.git/ '
)
).toBe('github.com/username/repository.git')
})
test('Testing - sanitizeRepoPathSsh', () => {
expect(
GitHelper.sanitizeRepoPathSsh(
' git@github.com:username/repository.git/ '
)
).toBe('git@github.com:username/repository.git')
})
test('Testing - sanitizeRepoPathSsh from HTTPS', () => {
expect(
GitHelper.sanitizeRepoPathSsh(
' https://github.com/username/repository.git/ '
)
).toBe('git@github.com:username/repository.git')
})
test('Testing - getDomainFromSanitizedSshRepoPath - pure', () => {
expect(
GitHelper.getDomainFromSanitizedSshRepoPath(
'git@github.com:username/repository.git'
)
).toBe('github.com')
})
test('Testing - getDomainFromSanitizedSshRepoPath', () => {
expect(
GitHelper.getDomainFromSanitizedSshRepoPath(
GitHelper.sanitizeRepoPathSsh(
' git@github.com:username/repository.git/ '
)
)
).toBe('github.com')
})
test('Testing - getDomainFromSanitizedSshRepoPath from HTTPS', () => {
expect(
GitHelper.getDomainFromSanitizedSshRepoPath(
GitHelper.sanitizeRepoPathSsh(
' https://github.com/username/repository.git/ '
)
)
).toBe('github.com')
})