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

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

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2025-03-01 - 1.3.1 - fix(test)
Update test script to fix type references and remove private method call
- Corrected type references in test script for IMonitorConfig.
- Fixed test script to use console.log instead of private method monitor.log.
## 2025-03-01 - 1.3.0 - feat(cli) ## 2025-03-01 - 1.3.0 - feat(cli)
Add CLI support with command parsing and version display Add CLI support with command parsing and version display

View File

@ -14,6 +14,9 @@
"buildDocs": "(tsdoc)", "buildDocs": "(tsdoc)",
"start": "(tsrun ./cli.ts -v)" "start": "(tsrun ./cli.ts -v)"
}, },
"bin": {
"tspm": "./cli.js"
},
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.25", "@git.zone/tsbuild": "^2.1.25",
"@git.zone/tsbundle": "^2.0.5", "@git.zone/tsbundle": "^2.0.5",

View File

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

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tspm', name: '@git.zone/tspm',
version: '1.3.0', version: '1.3.1',
description: 'a no fuzz process manager' description: 'a no fuzz process manager'
} }