Skip to content

Commit

Permalink
Add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold committed Dec 6, 2023
1 parent 467302e commit 2f9447c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/init/frameworks/repo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ describe("composer", () => {
);
});

it("re-uses existing repository it already exists", async () => {
getConnectionStub.resolves(completeConn);
fetchLinkableRepositoriesStub.resolves(repos);
promptOnceStub.onFirstCall().resolves(repos.repositories[0].remoteUri);
getRepositoryStub.resolves(repos.repositories[0]);

const r = await repo.getOrCreateRepository(
projectId,
location,
connectionId,
repos.repositories[0].remoteUri
);
expect(r).to.be.deep.equal(repos.repositories[0]);
});

it("throws error if no linkable repositories are available", async () => {
getConnectionStub.resolves(pendingConn);
fetchLinkableRepositoriesStub.resolves({ repositories: [] });
Expand Down

0 comments on commit 2f9447c

Please sign in to comment.