diff options
Diffstat (limited to 'test/unit/repository.unit.test.ts')
-rw-r--r-- | test/unit/repository.unit.test.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/unit/repository.unit.test.ts b/test/unit/repository.unit.test.ts index 7d3f954..dfb158d 100644 --- a/test/unit/repository.unit.test.ts +++ b/test/unit/repository.unit.test.ts @@ -35,6 +35,12 @@ describe("Repository", () => { await expect(Repository.open(env.BASE_DIR, env.UNAVAIL_REPO)).rejects.toBeInstanceOf(BaseError); }); + it("Should fail to open a repository with a nonexistant branch", async() => { + expect.assertions(1); + + await expect(Repository.open(env.BASE_DIR, env.AVAIL_REPO, "wubbalubbadubdub")).rejects.toBeInstanceOf(BaseError); + }); + it("Should open all repositories", async() => { expect.hasAssertions(); @@ -57,6 +63,33 @@ describe("Repository", () => { repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); }); + it("Should get the description", async() => { + expect.assertions(2); + + const description = await repository.description(); + + expect(description).toBeDefined(); + expect(description.length).toBeGreaterThan(1); + }); + + it("Should get the owner", async() => { + expect.assertions(2); + + const owner = await repository.owner(); + + expect(owner).toBeDefined(); + expect(owner).toEqual("Bob"); + }); + + it("Should get the branch", async() => { + expect.assertions(2); + + const branch = await repository.branch(); + + expect(branch).toBeDefined(); + expect(branch).toBeInstanceOf(Branch); + }); + it("Should look up if an existent object exists and respond true", async() => { expect.assertions(1); |