@@ -21,7 +21,7 @@ describe('syncConfigs', () => {
2121
2222 expect ( result . files . map ( ( { action } ) => action ) ) . toEqual ( [ 'created' , 'created' ] ) ;
2323 expect ( result . gitignore . updated ) . toBe ( true ) ;
24- expect ( result . gitignore . added ) . toEqual ( [ 'env/.env.local' , '.secrets.yml' ] ) ;
24+ expect ( result . gitignore . added ) . toEqual ( [ '/ env/.env.local' , '/ .secrets.yml' ] ) ;
2525
2626 await expect ( readFile ( path . join ( rootDir , 'env/.env.local' ) , 'utf8' ) ) . resolves . toBe (
2727 'TOKEN=secret' ,
@@ -32,8 +32,8 @@ describe('syncConfigs', () => {
3232
3333 const gitignore = await readFile ( path . join ( rootDir , '.gitignore' ) , 'utf8' ) ;
3434 expect ( gitignore ) . toContain ( '# Managed by cpconfig' ) ;
35- expect ( gitignore ) . toContain ( 'env/.env.local' ) ;
36- expect ( gitignore ) . toContain ( '.secrets.yml' ) ;
35+ expect ( gitignore ) . toContain ( '/ env/.env.local' ) ;
36+ expect ( gitignore ) . toContain ( '/ .secrets.yml' ) ;
3737 } ) ;
3838 } ) ;
3939
@@ -74,11 +74,11 @@ describe('syncConfigs', () => {
7474 ] ) ;
7575 expect ( result . gitignore . updated ) . toBe ( true ) ;
7676 expect ( result . gitignore . added ) . toEqual ( [ ] ) ;
77- expect ( result . gitignore . removed ) . toEqual ( [ 'config/b.json' ] ) ;
77+ expect ( result . gitignore . removed ) . toEqual ( [ '/ config/b.json' ] ) ;
7878
7979 const gitignore = await readFile ( path . join ( rootDir , '.gitignore' ) , 'utf8' ) ;
80- expect ( gitignore ) . toContain ( 'config/a.json' ) ;
81- expect ( gitignore ) . not . toContain ( 'config/b.json' ) ;
80+ expect ( gitignore ) . toContain ( '/ config/a.json' ) ;
81+ expect ( gitignore ) . not . toContain ( '/ config/b.json' ) ;
8282 } ) ;
8383 } ) ;
8484
@@ -116,8 +116,8 @@ describe('syncConfigs', () => {
116116 ) ;
117117
118118 const gitignore = await readFile ( path . join ( rootDir , '.gitignore' ) , 'utf8' ) ;
119- expect ( gitignore ) . toContain ( 'secret.log' ) ;
120- expect ( gitignore ) . not . toContain ( 'visible.log' ) ;
119+ expect ( gitignore ) . toContain ( '/ secret.log' ) ;
120+ expect ( gitignore ) . not . toContain ( '/ visible.log' ) ;
121121 } ) ;
122122 } ) ;
123123
0 commit comments