@@ -9,14 +9,14 @@ import ManagerSettings from '../../../../../src/r2mm/manager/ManagerSettings';
99import FileUtils from '../../../../../src/utils/FileUtils' ;
1010import GameDirectoryResolverProvider from '../../../../../src/providers/ror2/game/GameDirectoryResolverProvider' ;
1111import { ManagerSettingsInterfaceHolder } from '../../../../../src/r2mm/manager/SettingsDexieStore' ;
12- import InMemoryFsProvider from " ../../../stubs/providers/InMemory.FsProvider" ;
13- import SettingsRedirectGameDirectoryResolver from " ../../../stubs/providers/SettingsRedirectGameDirectoryResolver" ;
12+ import InMemoryFsProvider from ' ../../../stubs/providers/InMemory.FsProvider' ;
13+ import SettingsRedirectGameDirectoryResolver from ' ../../../stubs/providers/SettingsRedirectGameDirectoryResolver' ;
1414import { describe , beforeAll , test , expect } from 'vitest' ;
1515import { providePathImplementation } from '../../../../../src/providers/node/path/path' ;
1616import { TestPathProvider } from '../../../stubs/providers/node/Node.Path.Provider' ;
1717import { provideAppWindowImplementation } from '../../../../../src/providers/node/app/app_window' ;
1818import { TestAppWindowProvider } from '../../../stubs/providers/node/AppWindow.Provider' ;
19- 2
19+
2020class ProfileProviderImpl extends ProfileProvider {
2121 ensureProfileDirectory ( directory : string , profile : string ) : void {
2222 FsProvider . instance . mkdirs ( path . join ( directory , profile ) ) ;
@@ -28,7 +28,7 @@ describe.skipIf(process.platform !== 'win32')('ModLinker', async () => {
2828 let settings ! : ManagerSettings ;
2929
3030 beforeAll ( async ( ) => {
31- providePathImplementation ( ( ) => TestPathProvider ) ;
31+ providePathImplementation ( ( ) => TestPathProvider ) ;
3232 provideAppWindowImplementation ( ( ) => TestAppWindowProvider ) ;
3333
3434 new Profile ( 'TestProfile' ) ;
@@ -46,32 +46,32 @@ describe.skipIf(process.platform !== 'win32')('ModLinker', async () => {
4646 // Hack to work around Dexie loading issue during test
4747 ( ManagerSettings [ 'CONTEXT' ] as any ) = ( {
4848 global : {
49- steamDirectory : " TEST_STEAM_PATH"
49+ steamDirectory : ' TEST_STEAM_PATH'
5050 } ,
5151 gameSpecific : {
52- gameDirectory : " TEST_GAME_DIRECTORY"
52+ gameDirectory : ' TEST_GAME_DIRECTORY'
5353 }
54- } as ManagerSettingsInterfaceHolder )
54+ } as ManagerSettingsInterfaceHolder ) ;
5555 // await settings.setGameDirectory("GAME_DIR");
5656 await FileUtils . ensureDirectory ( settings . getContext ( ) . gameSpecific . gameDirectory ! ) ;
5757 } ) ;
5858
5959 test ( 'Install, no existing files' , async ( ) => {
60- const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( " test_file" ) ;
61- await FsProvider . instance . writeFile ( testFile , " content" ) ;
62- expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , " test_file" ) ) ) . toBeFalsy ( ) ;
60+ const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( ' test_file' ) ;
61+ await FsProvider . instance . writeFile ( testFile , ' content' ) ;
62+ expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , ' test_file' ) ) ) . toBeFalsy ( ) ;
6363 await ModLinker . link ( Profile . getActiveAsImmutableProfile ( ) , GameManager . defaultGame ) ;
64- expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , " test_file" ) ) ) . toBeTruthy ( ) ;
64+ expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , ' test_file' ) ) ) . toBeTruthy ( ) ;
6565 } ) ;
6666
6767 test ( 'Install, file already exists, no overwrite' , async ( ) => {
68- const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( " test_file" ) ;
68+ const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( ' test_file' ) ;
6969 expect ( await FsProvider . instance . exists ( testFile ) ) . toBeTruthy ( ) ;
7070 const oldStat = await FsProvider . instance . stat ( testFile ) ;
7171 await new Promise ( resolve => {
7272 setTimeout ( async ( ) => {
7373 await ModLinker . link ( Profile . getActiveAsImmutableProfile ( ) , GameManager . defaultGame ) ;
74- expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , " test_file" ) ) ) . toBeTruthy ( ) ;
74+ expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , ' test_file' ) ) ) . toBeTruthy ( ) ;
7575 const newStat = await FsProvider . instance . stat ( testFile ) ;
7676 expect ( newStat . mtime ) . toEqual ( oldStat . mtime ) ;
7777 resolve ( undefined ) ;
@@ -80,14 +80,14 @@ describe.skipIf(process.platform !== 'win32')('ModLinker', async () => {
8080 } ) ;
8181
8282 test ( 'Install, file already exists, overwritten' , async ( ) => {
83- const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( " test_file" ) ;
83+ const testFile = Profile . getActiveProfile ( ) . joinToProfilePath ( ' test_file' ) ;
8484 expect ( await FsProvider . instance . exists ( testFile ) ) . toBeTruthy ( ) ;
8585 const oldStat = await FsProvider . instance . stat ( testFile ) ;
86- await FsProvider . instance . writeFile ( testFile , " modified" ) ;
86+ await FsProvider . instance . writeFile ( testFile , ' modified' ) ;
8787 await new Promise ( resolve => {
8888 setTimeout ( async ( ) => {
8989 await ModLinker . link ( Profile . getActiveAsImmutableProfile ( ) , GameManager . defaultGame ) ;
90- expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , " test_file" ) ) ) . toBeTruthy ( ) ;
90+ expect ( await FsProvider . instance . exists ( path . join ( settings . getContext ( ) . gameSpecific . gameDirectory ! , ' test_file' ) ) ) . toBeTruthy ( ) ;
9191 const newStat = await FsProvider . instance . stat ( testFile ) ;
9292 expect ( newStat . mtime ) . not . toEqual ( oldStat . mtime ) ;
9393 resolve ( undefined ) ;
0 commit comments