@@ -25,27 +25,25 @@ it('sets properties correctly on create', async () => {
25
25
expect ( repository ) . toMatchSnapshot ( ) ;
26
26
} ) ;
27
27
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 } /../..` ;
32
31
33
- const mainBranchName = 'main' ;
34
- const branch = await repository . currentBranch ( ) ;
32
+ const branches = await repository . localBranches ( ) ;
35
33
36
- expect ( branch ) . toBe ( mainBranchName ) ;
37
- } ) ;
34
+ expect ( branches . all . length ) . toBeGreaterThan ( 0 ) ;
35
+ } ) ;
38
36
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 } /../..` ;
42
40
43
- const mainBranchName = 'main' ;
44
- const branches = await repository . localBranches ( ) ;
41
+ const branch = await repository . currentBranch ( ) ;
45
42
46
- expect ( branches . all ) . toContain ( mainBranchName ) ;
47
- } ) ;
43
+ expect ( branch . match ( / m a i n | p u l l . + / ) ) . toBeTruthy ( ) ;
44
+ } ) ;
48
45
46
+ if ( typeof process . env . CI === 'undefined' ) {
49
47
it ( 'checks if it is on a branch' , async ( ) => {
50
48
const repository = new Repository ( 'permafrost-dev/codeboost' , tempPath ) ;
51
49
repository . path = `${ __dirname } /../..` ;
0 commit comments