fix(test): Update test script to fix type references and remove private method call

This commit is contained in:
2025-03-01 19:47:46 +00:00
parent 51bb3a8967
commit cefbce1ba0
4 changed files with 13 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ tap.test('first test', async () => {
tap.start();
// Example usage:
const config: IMonitorConfig = {
const config: tspm.IMonitorConfig = {
name: 'Project XYZ Monitor', // Identifier for the instance
projectDir: '/path/to/your/project', // Set the project directory here
command: 'npm run xyz', // Full command string (no need for args)
@@ -16,12 +16,12 @@ const config: IMonitorConfig = {
monitorIntervalMs: 5000, // Check memory usage every 5 seconds
};
const monitor = new ProcessMonitor(config);
const monitor = new tspm.ProcessMonitor(config);
monitor.start();
// Ensure that on process exit (e.g. Ctrl+C) we clean up the child process and prevent respawns.
process.on('SIGINT', () => {
monitor.log('Received SIGINT, stopping monitor...');
console.log('Received SIGINT, stopping monitor...');
monitor.stop();
process.exit();
});