@aiready/testability 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/testability@0.4.21 build /Users/pengcao/projects/aiready/packages/testability
3
+ > @aiready/testability@0.6.0 build /Users/pengcao/projects/aiready/packages/testability
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -11,13 +11,13 @@
11
11
  ESM Build start
12
12
  CJS dist/cli.js 15.61 KB
13
13
  CJS dist/index.js 10.73 KB
14
- CJS ⚡️ Build success in 179ms
15
- ESM dist/cli.mjs 5.75 KB
14
+ CJS ⚡️ Build success in 41ms
16
15
  ESM dist/index.mjs 1.28 KB
16
+ ESM dist/cli.mjs 5.75 KB
17
17
  ESM dist/chunk-QOIBI5E7.mjs 8.31 KB
18
- ESM ⚡️ Build success in 179ms
18
+ ESM ⚡️ Build success in 40ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 2375ms
20
+ DTS ⚡️ Build success in 1497ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
22
  DTS dist/index.d.ts 2.41 KB
23
23
  DTS dist/cli.d.mts 20.00 B
@@ -1,19 +1,114 @@
1
1
 
2
2
  
3
- > @aiready/testability@0.4.21 test /Users/pengcao/projects/aiready/packages/testability
3
+ > @aiready/testability@0.6.0 test /Users/pengcao/projects/aiready/packages/testability
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/testability
8
8
 
9
- ✓ src/__tests__/scoring.test.ts (3 tests) 5ms
10
- ✓ src/__tests__/provider.test.ts (2 tests) 10ms
11
- ✓ src/__tests__/analyzer.test.ts (5 tests) 1659ms
12
- ✓ detects test frameworks in multiple languages  1635ms
9
+ [?2026h
10
+  src/__tests__/provider.test.ts [queued]
13
11
 
14
-  Test Files  3 passed (3)
15
-  Tests  10 passed (10)
16
-  Start at  18:20:54
17
-  Duration  4.09s (transform 978ms, setup 0ms, import 5.11s, tests 1.67s, environment 0ms)
12
+  Test Files 0 passed (4)
13
+  Tests 0 passed (0)
14
+  Start at 17:20:11
15
+  Duration 731ms
16
+ [?2026l[?2026h
17
+  ❯ src/__tests__/provider.test.ts [queued]
18
+  ❯ src/__tests__/types.test.ts [queued]
19
+
20
+  Test Files 0 passed (4)
21
+  Tests 0 passed (0)
22
+  Start at 17:20:11
23
+  Duration 833ms
24
+ [?2026l[?2026h
25
+  ❯ src/__tests__/analyzer.test.ts [queued]
26
+  ❯ src/__tests__/provider.test.ts [queued]
27
+  ❯ src/__tests__/scoring.test.ts [queued]
28
+  ❯ src/__tests__/types.test.ts [queued]
29
+
30
+  Test Files 0 passed (4)
31
+  Tests 0 passed (0)
32
+  Start at 17:20:11
33
+  Duration 1.17s
34
+ [?2026l[?2026h
35
+  ❯ src/__tests__/analyzer.test.ts [queued]
36
+  ❯ src/__tests__/provider.test.ts [queued]
37
+  ❯ src/__tests__/scoring.test.ts [queued]
38
+  ❯ src/__tests__/types.test.ts 0/4
39
+
40
+  Test Files 0 passed (4)
41
+  Tests 0 passed (4)
42
+  Start at 17:20:11
43
+  Duration 1.32s
44
+ [?2026l[?2026h
45
+  ❯ src/__tests__/analyzer.test.ts [queued]
46
+  ❯ src/__tests__/provider.test.ts [queued]
47
+  ❯ src/__tests__/scoring.test.ts [queued]
48
+  ❯ src/__tests__/types.test.ts 1/4
49
+
50
+  Test Files 0 passed (4)
51
+  Tests 1 passed (4)
52
+  Start at 17:20:11
53
+  Duration 1.62s
54
+ [?2026l[?2026h ✓ src/__tests__/types.test.ts (4 tests) 140ms
55
+
56
+  ❯ src/__tests__/analyzer.test.ts [queued]
57
+  ❯ src/__tests__/provider.test.ts [queued]
58
+  ❯ src/__tests__/scoring.test.ts [queued]
59
+
60
+  Test Files 1 passed (4)
61
+  Tests 4 passed (4)
62
+  Start at 17:20:11
63
+  Duration 2.11s
64
+ [?2026l[?2026h
65
+  ❯ src/__tests__/analyzer.test.ts [queued]
66
+  ❯ src/__tests__/provider.test.ts [queued]
67
+  ❯ src/__tests__/scoring.test.ts [queued]
68
+
69
+  Test Files 1 passed (4)
70
+  Tests 4 passed (4)
71
+  Start at 17:20:11
72
+  Duration 3.07s
73
+ [?2026l[?2026h
74
+  ❯ src/__tests__/analyzer.test.ts [queued]
75
+  ❯ src/__tests__/provider.test.ts 0/2
76
+  ❯ src/__tests__/scoring.test.ts [queued]
77
+
78
+  Test Files 1 passed (4)
79
+  Tests 4 passed (6)
80
+  Start at 17:20:11
81
+  Duration 3.37s
82
+ [?2026l[?2026h ✓ src/__tests__/provider.test.ts (2 tests) 5ms
83
+
84
+  ❯ src/__tests__/analyzer.test.ts 0/5
85
+  ❯ src/__tests__/scoring.test.ts [queued]
86
+
87
+  Test Files 2 passed (4)
88
+  Tests 6 passed (11)
89
+  Start at 17:20:11
90
+  Duration 3.48s
91
+ [?2026l[?2026h ✓ src/__tests__/scoring.test.ts (3 tests) 23ms
92
+
93
+  ❯ src/__tests__/analyzer.test.ts 0/5
94
+
95
+  Test Files 3 passed (4)
96
+  Tests 9 passed (14)
97
+  Start at 17:20:11
98
+  Duration 4.08s
99
+ [?2026l[?2026h
100
+  ❯ src/__tests__/analyzer.test.ts 1/5
101
+
102
+  Test Files 3 passed (4)
103
+  Tests 10 passed (14)
104
+  Start at 17:20:11
105
+  Duration 4.79s
106
+ [?2026l ✓ src/__tests__/analyzer.test.ts (5 tests) 1345ms
107
+ ✓ detects test frameworks in multiple languages  1319ms
108
+
109
+  Test Files  4 passed (4)
110
+  Tests  14 passed (14)
111
+  Start at  17:20:11
112
+  Duration  4.90s (transform 3.18s, setup 0ms, import 8.22s, tests 1.51s, environment 0ms)
18
113
 
19
114
  [?25h
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/testability",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Measures how safely and verifiably AI-generated changes can be made to your codebase",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -40,7 +40,7 @@
40
40
  "chalk": "^5.3.0",
41
41
  "commander": "^14.0.0",
42
42
  "glob": "^13.0.0",
43
- "@aiready/core": "0.22.0"
43
+ "@aiready/core": "0.23.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^24.0.0",
@@ -0,0 +1,72 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import type { TestabilityOptions, TestabilityReport } from '../types';
3
+
4
+ describe('Testability Types', () => {
5
+ describe('TestabilityOptions', () => {
6
+ it('should allow required rootDir', () => {
7
+ const options: TestabilityOptions = {
8
+ rootDir: '/test/project',
9
+ };
10
+
11
+ expect(options.rootDir).toBe('/test/project');
12
+ });
13
+
14
+ it('should allow optional minCoverageRatio', () => {
15
+ const options: TestabilityOptions = {
16
+ rootDir: '/test/project',
17
+ minCoverageRatio: 0.5,
18
+ };
19
+
20
+ expect(options.minCoverageRatio).toBe(0.5);
21
+ });
22
+
23
+ it('should allow custom test patterns', () => {
24
+ const options: TestabilityOptions = {
25
+ rootDir: '/test/project',
26
+ testPatterns: ['**/*.test.ts', '**/*.spec.ts', '**/*.e2e.ts'],
27
+ };
28
+
29
+ expect(options.testPatterns).toHaveLength(3);
30
+ });
31
+ });
32
+
33
+ describe('TestabilityReport', () => {
34
+ it('should structure summary correctly', () => {
35
+ const report: TestabilityReport = {
36
+ summary: {
37
+ sourceFiles: 100,
38
+ testFiles: 30,
39
+ coverageRatio: 0.3,
40
+ score: 60,
41
+ rating: 'moderate',
42
+ aiChangeSafetyRating: 'moderate-risk',
43
+ dimensions: {
44
+ testCoverageRatio: 30,
45
+ purityScore: 70,
46
+ dependencyInjectionScore: 50,
47
+ interfaceFocusScore: 80,
48
+ observabilityScore: 60,
49
+ },
50
+ },
51
+ issues: [],
52
+ rawData: {
53
+ sourceFiles: 100,
54
+ testFiles: 30,
55
+ pureFunctions: 80,
56
+ totalFunctions: 100,
57
+ injectionPatterns: 5,
58
+ totalClasses: 20,
59
+ bloatedInterfaces: 10,
60
+ totalInterfaces: 50,
61
+ externalStateMutations: 15,
62
+ hasTestFramework: true,
63
+ },
64
+ recommendations: ['Add more tests to reach 30% coverage'],
65
+ };
66
+
67
+ expect(report.summary.sourceFiles).toBe(100);
68
+ expect(report.summary.coverageRatio).toBe(0.3);
69
+ expect(report.rawData.hasTestFramework).toBe(true);
70
+ });
71
+ });
72
+ });