Compare commits

...

8 Commits

8 changed files with 52 additions and 18 deletions

View File

@ -1,5 +1,31 @@
# Changelog # Changelog
## 2025-05-26 - 2.2.4 - fix(logging)
Improve performance metrics reporting and add local permissions configuration
- Add .claude/settings.local.json to configure allowed permissions for various commands
- Update tstest logging: compute average test duration from actual durations and adjust slowest test display formatting
## 2025-05-26 - 2.2.3 - fix(readme/ts/tstest.plugins)
Update npm package scope and documentation to use '@git.zone' instead of '@gitzone', and add local settings configuration.
- Changed npm package links and source repository URLs in readme from '@gitzone/tstest' to '@git.zone/tstest'.
- Updated comments in ts/tstest.plugins.ts to reflect the correct '@git.zone' scope.
- Added .claude/settings.local.json file with local permission settings.
## 2025-05-26 - 2.2.2 - fix(config)
Cleanup project configuration by adding local CLAUDE settings and removing redundant license files
- Added .claude/settings.local.json with updated permissions for CLI and build tasks
- Removed license and license.md files to streamline repository content
## 2025-05-26 - 2.2.1 - fix(repo configuration)
Update repository metadata to use 'git.zone' naming and add local permission settings
- Changed githost from 'gitlab.com' to 'code.foss.global' and gitscope from 'gitzone' to 'git.zone' in npmextra.json
- Updated npm package name from '@gitzone/tstest' to '@git.zone/tstest' in npmextra.json and readme.md
- Added .claude/settings.local.json with new permission configuration
## 2025-05-26 - 2.2.0 - feat(watch mode) ## 2025-05-26 - 2.2.0 - feat(watch mode)
Add watch mode support with CLI options and enhanced documentation Add watch mode support with CLI options and enhanced documentation

View File

View File

@ -6,11 +6,11 @@
"gitzone": { "gitzone": {
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "code.foss.global",
"gitscope": "gitzone", "gitscope": "git.zone",
"gitrepo": "tstest", "gitrepo": "tstest",
"description": "a test utility to run tests that match test/**/*.ts", "description": "a test utility to run tests that match test/**/*.ts",
"npmPackagename": "@gitzone/tstest", "npmPackagename": "@git.zone/tstest",
"license": "MIT" "license": "MIT"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@git.zone/tstest", "name": "@git.zone/tstest",
"version": "2.2.0", "version": "2.2.4",
"private": false, "private": false,
"description": "a test utility to run tests that match test/**/*.ts", "description": "a test utility to run tests that match test/**/*.ts",
"exports": { "exports": {

View File

@ -1,9 +1,9 @@
# @gitzone/tstest # @git.zone/tstest
🧪 **A powerful, modern test runner for TypeScript** - making your test runs beautiful and informative! 🧪 **A powerful, modern test runner for TypeScript** - making your test runs beautiful and informative!
## Availabililty and Links ## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@gitzone/tstest) * [npmjs.org (npm package)](https://www.npmjs.com/package/@git.zone/tstest)
* [code.foss.global (source)](https://code.foss.global/gitzone/tstest) * [code.foss.global (source)](https://code.foss.global/git.zone/tstest)
## Why tstest? ## Why tstest?
@ -37,9 +37,9 @@
## Installation ## Installation
```bash ```bash
npm install --save-dev @gitzone/tstest npm install --save-dev @git.zone/tstest
# or with pnpm # or with pnpm
pnpm add -D @gitzone/tstest pnpm add -D @git.zone/tstest
``` ```
## Usage ## Usage

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tstest', name: '@git.zone/tstest',
version: '2.2.0', version: '2.2.4',
description: 'a test utility to run tests that match test/**/*.ts' description: 'a test utility to run tests that match test/**/*.ts'
} }

View File

@ -425,15 +425,23 @@ export class TsTestLogger {
// Performance metrics // Performance metrics
if (this.options.verbose) { if (this.options.verbose) {
const avgDuration = Math.round(totalDuration / summary.totalTests); // Calculate metrics based on actual test durations
const slowestTest = this.fileResults const allTests = this.fileResults.flatMap(r => r.tests);
.flatMap(r => r.tests) const testDurations = allTests.map(t => t.duration);
.sort((a, b) => b.duration - a.duration)[0]; const sumOfTestDurations = testDurations.reduce((sum, d) => sum + d, 0);
const avgTestDuration = allTests.length > 0 ? Math.round(sumOfTestDurations / allTests.length) : 0;
// Find slowest test (exclude 0ms durations unless all are 0)
const nonZeroDurations = allTests.filter(t => t.duration > 0);
const testsToSort = nonZeroDurations.length > 0 ? nonZeroDurations : allTests;
const slowestTest = testsToSort.sort((a, b) => b.duration - a.duration)[0];
this.log(this.format('\n⏱ Performance Metrics:', 'cyan')); this.log(this.format('\n⏱ Performance Metrics:', 'cyan'));
this.log(this.format(` Average per test: ${avgDuration}ms`, 'white')); this.log(this.format(` Average per test: ${avgTestDuration}ms`, 'white'));
if (slowestTest) { if (slowestTest && slowestTest.duration > 0) {
this.log(this.format(` Slowest test: ${slowestTest.name} (${slowestTest.duration}ms)`, 'yellow')); this.log(this.format(` Slowest test: ${slowestTest.name} (${slowestTest.duration}ms)`, 'orange'));
} else if (allTests.length > 0) {
this.log(this.format(` All tests completed in <1ms`, 'dim'));
} }
} }

View File

@ -33,7 +33,7 @@ export {
tapbundle, tapbundle,
}; };
// @gitzone scope // @git.zone scope
import * as tsbundle from '@git.zone/tsbundle'; import * as tsbundle from '@git.zone/tsbundle';
export { tsbundle }; export { tsbundle };