@@ -1000,10 +1000,13 @@ describe('Project', () => {
10001000 const observed = [ ]
10011001 const disposable = atom . project . onDidAddRepository ( ( repo ) => observed . push ( repo ) )
10021002
1003- const repositoryPath = path . join ( __dirname , '..' )
1004- atom . project . addPath ( repositoryPath )
1003+ const projectRootPath = temp . mkdirSync ( )
1004+ const fixtureRepoPath = fs . absolute ( path . join ( __dirname , 'fixtures' , 'git' , 'master.git' ) )
1005+ fs . copySync ( fixtureRepoPath , path . join ( projectRootPath , '.git' ) )
1006+
1007+ atom . project . addPath ( projectRootPath )
10051008 expect ( observed . length ) . toBe ( 1 )
1006- expect ( observed [ 0 ] . getOriginURL ( ) ) . toContain ( 'atom/atom ')
1009+ expect ( observed [ 0 ] . getOriginURL ( ) ) . toEqual ( 'https://github.com/example-user/example-repo.git ')
10071010
10081011 disposable . dispose ( )
10091012 } )
@@ -1012,9 +1015,16 @@ describe('Project', () => {
10121015 const observed = [ ]
10131016 const disposable = atom . project . onDidAddRepository ( ( repo ) => observed . push ( repo ) )
10141017
1015- atom . project . addPath ( __dirname )
1018+ const projectRootPath = temp . mkdirSync ( )
1019+ const fixtureRepoPath = fs . absolute ( path . join ( __dirname , 'fixtures' , 'git' , 'master.git' ) )
1020+ fs . copySync ( fixtureRepoPath , path . join ( projectRootPath , '.git' ) )
1021+
1022+ const projectSubDirPath = path . join ( projectRootPath , 'sub-dir' )
1023+ fs . mkdirSync ( projectSubDirPath )
1024+
1025+ atom . project . addPath ( projectSubDirPath )
10161026 expect ( observed . length ) . toBe ( 1 )
1017- expect ( observed [ 0 ] . getOriginURL ( ) ) . toContain ( 'atom/atom ')
1027+ expect ( observed [ 0 ] . getOriginURL ( ) ) . toEqual ( 'https://github.com/example-user/example-repo.git ')
10181028
10191029 disposable . dispose ( )
10201030 } )
0 commit comments