diff --git a/src/test/init/frameworks/repo.spec.ts b/src/test/init/frameworks/repo.spec.ts index 6302a9933a0..4cb48726b44 100644 --- a/src/test/init/frameworks/repo.spec.ts +++ b/src/test/init/frameworks/repo.spec.ts @@ -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: [] });