@@ -10,6 +10,11 @@ describe('global-settings', () => {
1010
1111 beforeEach ( ( ) => {
1212 tempDir = createTempDir ( ) ;
13+ // Create shops directory for settings
14+ const shopsDir = path . join ( tempDir , 'shops' ) ;
15+ if ( ! fs . existsSync ( shopsDir ) ) {
16+ fs . mkdirSync ( shopsDir , { recursive : true } ) ;
17+ }
1318 } ) ;
1419
1520 afterEach ( ( ) => {
@@ -39,7 +44,7 @@ describe('global-settings', () => {
3944 version : '1.0.0'
4045 } ;
4146
42- const settingsPath = path . join ( tempDir , 'settings.json' ) ;
47+ const settingsPath = path . join ( tempDir , 'shops' , ' settings.json') ;
4348 fs . writeFileSync ( settingsPath , JSON . stringify ( settings , null , 2 ) ) ;
4449
4550 // Act
@@ -54,7 +59,7 @@ describe('global-settings', () => {
5459
5560 test ( 'handles corrupted settings file' , async ( ) => {
5661 // Arrange
57- const settingsPath = path . join ( tempDir , 'settings.json' ) ;
62+ const settingsPath = path . join ( tempDir , 'shops' , ' settings.json') ;
5863 fs . writeFileSync ( settingsPath , '{ invalid json }' ) ;
5964
6065 // Act
@@ -84,7 +89,7 @@ describe('global-settings', () => {
8489 // Assert
8590 expect ( result . success ) . toBe ( true ) ;
8691
87- const settingsPath = path . join ( tempDir , 'settings.json' ) ;
92+ const settingsPath = path . join ( tempDir , 'shops' , ' settings.json') ;
8893 expect ( fs . existsSync ( settingsPath ) ) . toBe ( true ) ;
8994
9095 const savedSettings = JSON . parse ( fs . readFileSync ( settingsPath , 'utf8' ) ) ;
@@ -119,7 +124,7 @@ describe('global-settings', () => {
119124 // Assert
120125 expect ( result . success ) . toBe ( true ) ;
121126
122- const settingsPath = path . join ( tempDir , 'settings.json' ) ;
127+ const settingsPath = path . join ( tempDir , 'shops' , ' settings.json') ;
123128 const savedSettings = JSON . parse ( fs . readFileSync ( settingsPath , 'utf8' ) ) ;
124129 expect ( savedSettings . contentProtection . defaultMode ) . toBe ( 'strict' ) ;
125130 } ) ;
0 commit comments