This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: stop using .netrc file, instead include credentials in the …
…HTTPS URL
- Loading branch information
Ryan Park
committed
May 11, 2022
1 parent
a2a603c
commit 191e9ce
Showing
9 changed files
with
24 additions
and
158 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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ const git = require('../src/git'); | |
|
||
const SAMPLE_APP_NAME = 'dr-owlbert-pr-1234'; | ||
const SAMPLE_REF = 'refs/heads/dev'; | ||
const SAMPLE_EMAIL = '[email protected]'; | ||
const SAMPLE_API_KEY = '12345678-1234-1234-1234-1234567890ab'; | ||
|
||
describe('#src/git', () => { | ||
afterEach(() => { | ||
|
@@ -48,13 +50,17 @@ describe('#src/git', () => { | |
const EXPECTED_ARGS = [ | ||
'push', | ||
'--force', | ||
`https://git.heroku.com/${SAMPLE_APP_NAME}.git`, | ||
`https://${encodeURIComponent(SAMPLE_EMAIL)}:${encodeURIComponent( | ||
SAMPLE_API_KEY | ||
)}@git.heroku.com/${SAMPLE_APP_NAME}.git`, | ||
`${SAMPLE_REF}:refs/heads/master`, | ||
]; | ||
|
||
const SAMPLE_CREDENTIALS = { email: SAMPLE_EMAIL, apiKey: SAMPLE_API_KEY }; | ||
|
||
it('should run "git push" with the correct arguments', () => { | ||
const spy = jest.spyOn(childProcess, 'spawnSync').mockReturnValue({ status: 0 }); | ||
expect(git.push(SAMPLE_APP_NAME, SAMPLE_REF)).toStrictEqual({ status: 0 }); | ||
expect(git.push(SAMPLE_CREDENTIALS, SAMPLE_APP_NAME, SAMPLE_REF)).toStrictEqual({ status: 0 }); | ||
expect(spy.mock.lastCall[0]).toBe('git'); | ||
expect(spy.mock.lastCall[1]).toStrictEqual(EXPECTED_ARGS); | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.