diff options
Diffstat (limited to 'test/unit/repository.unit.test.ts')
-rw-r--r-- | test/unit/repository.unit.test.ts | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/test/unit/repository.unit.test.ts b/test/unit/repository.unit.test.ts index dfb158d..dd0d09b 100644 --- a/test/unit/repository.unit.test.ts +++ b/test/unit/repository.unit.test.ts @@ -18,45 +18,47 @@ function expectRepositoryProperties(repository: Repository) { } describe("Repository", () => { - it("Should open a repository", async() => { - expect.assertions(8); + describe("Class methods", () => { + it("Should open a repository", async() => { + expect.assertions(8); - const repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); + const repository = await Repository.open(env.BASE_DIR, env.AVAIL_REPO); - expect(repository).toBeDefined(); - expect(repository).toBeInstanceOf(Repository); + expect(repository).toBeDefined(); + expect(repository).toBeInstanceOf(Repository); - expectRepositoryProperties(repository); - }); + expectRepositoryProperties(repository); + }); - it("Should fail to open a nonexistant repository", async() => { - expect.assertions(1); + it("Should fail to open a nonexistant repository", async() => { + expect.assertions(1); - await expect(Repository.open(env.BASE_DIR, env.UNAVAIL_REPO)).rejects.toBeInstanceOf(BaseError); - }); + 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); + 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); - }); + await expect(Repository.open(env.BASE_DIR, env.AVAIL_REPO, "wubbalubbadubdub")).rejects.toBeInstanceOf(BaseError); + }); - it("Should open all repositories", async() => { - expect.hasAssertions(); + it("Should open all repositories", async() => { + expect.hasAssertions(); - const all_repositories = await Repository.openAll(env.BASE_DIR); + const all_repositories = await Repository.openAll(env.BASE_DIR); - expect(all_repositories).toBeDefined(); + expect(all_repositories).toBeDefined(); - for(const repository of all_repositories) { - expect(repository).toBeDefined(); - expect(repository).toBeInstanceOf(Repository); + for(const repository of all_repositories) { + expect(repository).toBeDefined(); + expect(repository).toBeInstanceOf(Repository); - expectRepositoryProperties(repository); - } + expectRepositoryProperties(repository); + } + }); }); - describe("Methods", () => { + describe("Instance methods", () => { let repository: Repository; beforeAll(async() => { |