@@ -1052,6 +1052,27 @@ test('computeDaemonCodeSignature fingerprints the daemon source tree', () => {
10521052 }
10531053} ) ;
10541054
1055+ test ( 'computeDaemonCodeSignature ignores source test files' , ( ) => {
1056+ const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-daemon-signature-tests-' ) ) ;
1057+ try {
1058+ const daemonEntryPath = path . join ( root , 'src' , 'daemon.ts' ) ;
1059+ const runtimePath = path . join ( root , 'src' , 'platforms' , 'ios' , 'perf.ts' ) ;
1060+ const testPath = path . join ( root , 'src' , 'platforms' , 'ios' , '__tests__' , 'perf.test.ts' ) ;
1061+ fs . mkdirSync ( path . dirname ( testPath ) , { recursive : true } ) ;
1062+ fs . writeFileSync ( daemonEntryPath , 'console.log("daemon");\n' , 'utf8' ) ;
1063+ fs . writeFileSync ( runtimePath , 'export const value = 1;\n' , 'utf8' ) ;
1064+ fs . writeFileSync ( testPath , 'export const ignored = 1;\n' , 'utf8' ) ;
1065+
1066+ const firstSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1067+ fs . writeFileSync ( testPath , 'export const ignored = 2;\n' , 'utf8' ) ;
1068+ const secondSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1069+
1070+ assert . equal ( secondSignature , firstSignature ) ;
1071+ } finally {
1072+ fs . rmSync ( root , { recursive : true , force : true } ) ;
1073+ }
1074+ } ) ;
1075+
10551076test ( 'stopDaemonProcessForTakeover terminates a matching daemon process' , async ( t ) => {
10561077 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-daemon-test-' ) ) ;
10571078 const daemonDir = path . join ( root , 'agent-device' , 'dist' , 'src' ) ;
0 commit comments