fix(logging): Improve warning logging and add permission settings file
This commit is contained in:
parent
e1d90589bc
commit
0954265095
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-05-24 - 1.11.4 - fix(logging)
|
||||||
|
Improve warning logging and add permission settings file
|
||||||
|
|
||||||
|
- Replace multiple logger.error calls with logger.warning for tests running over 1 minute
|
||||||
|
- Add warning method in tstest logger to display warning messages consistently
|
||||||
|
- Introduce .claude/settings.local.json to configure allowed permissions
|
||||||
|
|
||||||
## 2025-05-24 - 1.11.3 - fix(tstest)
|
## 2025-05-24 - 1.11.3 - fix(tstest)
|
||||||
Add timeout warning for long-running tests and introduce local settings configuration
|
Add timeout warning for long-running tests and introduce local settings configuration
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tstest',
|
name: '@git.zone/tstest',
|
||||||
version: '1.11.3',
|
version: '1.11.4',
|
||||||
description: 'a test utility to run tests that match test/**/*.ts'
|
description: 'a test utility to run tests that match test/**/*.ts'
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,9 @@ export class TsTest {
|
|||||||
// Start timeout warning timer if no timeout was specified
|
// Start timeout warning timer if no timeout was specified
|
||||||
if (this.timeoutSeconds === null) {
|
if (this.timeoutSeconds === null) {
|
||||||
this.timeoutWarningTimer = setTimeout(() => {
|
this.timeoutWarningTimer = setTimeout(() => {
|
||||||
// Use the logger instead of console.error to ensure the warning is visible
|
this.logger.warning('Test is running for more than 1 minute.');
|
||||||
this.logger.error('Warning: Test is running for more than 1 minute.');
|
this.logger.warning('Consider using --timeout option to set a timeout for test files.');
|
||||||
this.logger.error('Consider using --timeout option to set a timeout for test files.');
|
this.logger.warning('Example: tstest test --timeout=300 (for 5 minutes)');
|
||||||
this.logger.error('Example: tstest test --timeout=300 (for 5 minutes)');
|
|
||||||
}, 60000); // 1 minute
|
}, 60000); // 1 minute
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,6 +443,20 @@ export class TsTestLogger {
|
|||||||
this.log(this.format(`\n${status}`, statusColor));
|
this.log(this.format(`\n${status}`, statusColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warning display
|
||||||
|
warning(message: string) {
|
||||||
|
if (this.options.json) {
|
||||||
|
this.logJson({ event: 'warning', message });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.options.quiet) {
|
||||||
|
console.log(`WARNING: ${message}`);
|
||||||
|
} else {
|
||||||
|
this.log(this.format(` ⚠️ ${message}`, 'orange'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Error display
|
// Error display
|
||||||
error(message: string, file?: string, stack?: string) {
|
error(message: string, file?: string, stack?: string) {
|
||||||
if (this.options.json) {
|
if (this.options.json) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user