BREAKING CHANGE(core): Add multi-UPS support and group management; update CLI, configuration and documentation to support multiple UPS devices with group modes

This commit is contained in:
2025-03-28 16:19:43 +00:00
parent bd3042de25
commit 0e55f22dad
10 changed files with 2381 additions and 780 deletions

View File

@ -51,21 +51,19 @@ tap.test('should handle width persistence between logbox calls', async () => {
expect(errorThrown).toBeFalsy();
});
tap.test('should throw error when using logBoxLine without width', async () => {
tap.test('should use default width when no width is specified', async () => {
// This should automatically use the default width instead of throwing
let errorThrown = false;
let errorMessage = '';
try {
// Should throw because no width is set
logger.logBoxLine('This should fail');
logger.logBoxLine('This should use default width');
logger.logBoxEnd();
} catch (error) {
errorThrown = true;
errorMessage = (error as Error).message;
}
expect(errorThrown).toBeTruthy();
expect(errorMessage).toBeTruthy();
expect(errorMessage.includes('No box width')).toBeTruthy();
// Verify no error was thrown
expect(errorThrown).toBeFalsy();
});
tap.test('should create a complete logbox in one call', async () => {
@ -99,6 +97,14 @@ tap.test('should create dividers with custom characters', async () => {
expect(true).toBeTruthy();
});
tap.test('should create divider with default width', async () => {
// This should use the default width
logger.logDivider(undefined, '-');
// Just assert that the test runs without errors
expect(true).toBeTruthy();
});
tap.test('Logger Demo', async () => {
console.log('\n=== LOGGER DEMO ===\n');
@ -135,10 +141,17 @@ tap.test('Logger Demo', async () => {
logger.logBoxLine('No need to specify the width again');
logger.logBoxEnd();
// Demonstrating default width
console.log('\nDefault Width Example:');
logger.logBoxLine('This line uses the default width');
logger.logBoxLine('Still using default width');
logger.logBoxEnd();
// Divider example
logger.log('\nDivider example:');
logger.logDivider(30);
logger.logDivider(30, '*');
logger.logDivider(undefined, '=');
expect(true).toBeTruthy();
});