Skip to content

Commit

Permalink
fix(scaffold-git): included the newline in the expected error message
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed May 15, 2023
1 parent 266d9ba commit aa3d0d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/vcs/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function getExistingRemotes(git) {
try {
return await git.listRemote();
} catch (e) {
if ('fatal: No remote configured to list refs from.' === e.message) {
if ('fatal: No remote configured to list refs from.\n' === e.message) {
return [];
}

Expand Down
3 changes: 1 addition & 2 deletions src/vcs/git.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ describe('git', () => {

describe('scaffold', () => {
it('should scaffold the git repo', async () => {
// listRemote.mockRejectedValue(new simpleGit.GitError(null, 'fatal: No remote configured to list refs from.'));
listRemote.mockRejectedValue(new Error('fatal: No remote configured to list refs from.'));
listRemote.mockRejectedValue(new Error('fatal: No remote configured to list refs from.\n'));

const results = await scaffold({projectRoot, origin: {}});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Given(/^the project should be versioned in git$/, async function () {
td.when(this.git.simpleGit(process.cwd())).thenReturn(simpleGitInstance);
td.when(simpleGitInstance.checkIsRepo('root')).thenResolve(false);
td.when(simpleGitInstance.listRemote())
.thenReject(new GitError(null, 'fatal: No remote configured to list refs from.'));
.thenReject(new GitError(null, 'fatal: No remote configured to list refs from.\n'));
});

Given(/^the project should not be versioned in git$/, async function () {
Expand Down

0 comments on commit aa3d0d9

Please sign in to comment.