-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kavitha Kesavalu
committed
Nov 2, 2024
1 parent
58b1e64
commit 6b4a34f
Showing
4 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
beforeEach(() => { | ||
process.env.SHEPHERD_GITHUB_ENTERPRISE_URL = 'https://api.github.com'; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,17 +268,19 @@ describe('GithubAdapter', () => { | |
|
||
it('returns the SSH URL, when not given a protocol', () => { | ||
delete process.env.SHEPHERD_GITHUB_PROTOCOL; | ||
expect(adapter['getRepositoryUrl'](repo)).toBe('[email protected]:NerdWallet/shepherd.git'); | ||
expect(adapter['getRepositoryUrl'](repo)).toBe('git@api.github.com:NerdWallet/shepherd.git'); | ||
}); | ||
|
||
it('returns the SSH URL, when given protocol=ssh', () => { | ||
process.env.SHEPHERD_GITHUB_PROTOCOL = 'ssh'; | ||
expect(adapter['getRepositoryUrl'](repo)).toBe('[email protected]:NerdWallet/shepherd.git'); | ||
expect(adapter['getRepositoryUrl'](repo)).toBe('git@api.github.com:NerdWallet/shepherd.git'); | ||
}); | ||
|
||
it('returns the HTTPS URL when given protocol=https', () => { | ||
process.env.SHEPHERD_GITHUB_PROTOCOL = 'https'; | ||
expect(adapter['getRepositoryUrl'](repo)).toBe('https://github.com/NerdWallet/shepherd.git'); | ||
expect(adapter['getRepositoryUrl'](repo)).toBe( | ||
'https://api.github.com/NerdWallet/shepherd.git' | ||
); | ||
}); | ||
|
||
it('throws on unexpected protocols', () => { | ||
|