Skip to content

Commit 1ec05ea

Browse files
committed
update tests
1 parent 79afaa8 commit 1ec05ea

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

tests/lib/Repository.test.ts

+13-15
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,25 @@ it('sets properties correctly on create', async () => {
2525
expect(repository).toMatchSnapshot();
2626
});
2727

28-
if (typeof process.env.CI === 'undefined') {
29-
it('gets the current branch names', async () => {
30-
const repository = new Repository('permafrost-dev/codeboost', tempPath);
31-
repository.path = `${__dirname}/../..`;
28+
it('gets a list of local branches', async () => {
29+
const repository = new Repository('permafrost-dev/codeboost', tempPath);
30+
repository.path = `${__dirname}/../..`;
3231

33-
const mainBranchName = 'main';
34-
const branch = await repository.currentBranch();
32+
const branches = await repository.localBranches();
3533

36-
expect(branch).toBe(mainBranchName);
37-
});
34+
expect(branches.all.length).toBeGreaterThan(0);
35+
});
3836

39-
it('gets a list of local branches', async () => {
40-
const repository = new Repository('permafrost-dev/codeboost', tempPath);
41-
repository.path = `${__dirname}/../..`;
37+
it('gets the current branch names', async () => {
38+
const repository = new Repository('permafrost-dev/codeboost', tempPath);
39+
repository.path = `${__dirname}/../..`;
4240

43-
const mainBranchName = 'main';
44-
const branches = await repository.localBranches();
41+
const branch = await repository.currentBranch();
4542

46-
expect(branches.all).toContain(mainBranchName);
47-
});
43+
expect(branch.match(/main|pull.+/)).toBeTruthy();
44+
});
4845

46+
if (typeof process.env.CI === 'undefined') {
4947
it('checks if it is on a branch', async () => {
5048
const repository = new Repository('permafrost-dev/codeboost', tempPath);
5149
repository.path = `${__dirname}/../..`;

0 commit comments

Comments
 (0)