11import { describe , expect , it } from 'vitest' ;
22import { cloneRepository , openRepository } from '../index' ;
3- import { LINUX } from './env' ;
3+ import { TARGET } from './env' ;
44import { useFixture } from './fixtures' ;
55import { makeTmpDir } from './tmp' ;
66
77describe ( 'remote' , ( ) => {
8- it ( 'get remote names' , { skip : LINUX } , async ( ) => {
8+ const isLinuxGnu = TARGET [ 0 ] === 'linux' && TARGET [ 2 ] === 'gnu' ;
9+
10+ it ( 'get remote names' , { skip : isLinuxGnu } , async ( ) => {
911 const p = await makeTmpDir ( 'clone' ) ;
10- const repo = await cloneRepository ( 'https://github.com/toss/es-toolkit ' , p ) ;
12+ const repo = await cloneRepository ( 'https://github.com/seokju-na/dummy-repo ' , p ) ;
1113 expect ( repo . remoteNames ( ) ) . toContain ( 'origin' ) ;
1214 } ) ;
1315
14- it ( 'get remote' , { skip : LINUX } , async ( ) => {
16+ it ( 'get remote' , { skip : isLinuxGnu } , async ( ) => {
1517 const p = await makeTmpDir ( 'clone' ) ;
16- const repo = await cloneRepository ( 'https://github.com/toss/es-toolkit ' , p ) ;
18+ const repo = await cloneRepository ( 'https://github.com/seokju-na/dummy-repo ' , p ) ;
1719 const remote = repo . getRemote ( 'origin' ) ;
1820 expect ( remote . name ( ) ) . toEqual ( 'origin' ) ;
19- expect ( remote . url ( ) ) . toEqual ( 'https://github.com/toss/es-toolkit ' ) ;
21+ expect ( remote . url ( ) ) . toEqual ( 'https://github.com/seokju-na/dummy-repo ' ) ;
2022 expect ( ( ) => repo . getRemote ( 'not_exists' ) ) . toThrowError ( / l i b g i t 2 e r r o r : r e m o t e ' n o t _ e x i s t s ' d o e s n o t e x i s t / ) ;
2123 } ) ;
2224
@@ -36,16 +38,16 @@ describe('remote', () => {
3638 expect ( remote . name ( ) ) . toEqual ( 'origin' ) ;
3739 } ) ;
3840
39- it ( 'fetch remote' , { skip : LINUX } , async ( ) => {
41+ it ( 'fetch remote' , { skip : isLinuxGnu } , async ( ) => {
4042 const p = await makeTmpDir ( 'clone' ) ;
41- const repo = await cloneRepository ( 'https://github.com/toss/es-toolkit ' , p ) ;
43+ const repo = await cloneRepository ( 'https://github.com/seokju-na/dummy-repo ' , p ) ;
4244 const remote = repo . getRemote ( 'origin' ) ;
4345 await remote . fetch ( [ 'main' ] ) ;
4446 } ) ;
4547
46- it ( 'get remote default branch' , { skip : LINUX } , async ( ) => {
48+ it ( 'get remote default branch' , { skip : isLinuxGnu } , async ( ) => {
4749 const p = await makeTmpDir ( 'clone' ) ;
48- const repo = await cloneRepository ( 'https://github.com/toss/es-toolkit ' , p ) ;
50+ const repo = await cloneRepository ( 'https://github.com/seokju-na/dummy-repo ' , p ) ;
4951 const remote = repo . getRemote ( 'origin' ) ;
5052 const branch = await remote . defaultBranch ( ) ;
5153 expect ( branch ) . toEqual ( 'refs/heads/main' ) ;
0 commit comments