Skip to content

Commit 53033f4

Browse files
chore: remove skipped placeholder tests
1 parent ca2c8e4 commit 53033f4

File tree

3 files changed

+46
-141
lines changed

3 files changed

+46
-141
lines changed

src/__tests__/integration/cli-integration.test.ts

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,14 @@ describe('CLI Integration', () => {
5454
});
5555

5656
expect(result).toContain('StackMemory initialized');
57-
57+
5858
// Check that .stackmemory directory was created
5959
const stackmemoryDir = path.join(testDir, '.stackmemory');
6060
expect(fs.existsSync(stackmemoryDir)).toBe(true);
6161
});
6262
});
6363

6464
describe('Status Command', () => {
65-
it.skip('should show status after init - needs database schema', () => {
66-
// Initialize first
67-
execSync(`node ${cliPath} init`, { cwd: testDir });
68-
69-
// Check status
70-
const result = execSync(`node ${cliPath} status`, {
71-
cwd: testDir,
72-
encoding: 'utf8',
73-
});
74-
75-
expect(result).toContain('StackMemory Status');
76-
expect(result).toContain('Initialized:');
77-
});
78-
7965
it('should handle status when not initialized', () => {
8066
try {
8167
execSync(`node ${cliPath} status`, {
@@ -100,19 +86,6 @@ describe('CLI Integration', () => {
10086

10187
expect(result).toContain('Context Usage');
10288
});
103-
104-
it.skip('should check if clear is recommended - needs git repo', () => {
105-
// Initialize first
106-
execSync(`node ${cliPath} init`, { cwd: testDir });
107-
108-
const result = execSync(`node ${cliPath} clear --check`, {
109-
cwd: testDir,
110-
encoding: 'utf8',
111-
});
112-
113-
// Should provide some recommendation
114-
expect(result.length).toBeGreaterThan(0);
115-
});
11689
});
11790

11891
describe('Workflow Command', () => {
@@ -141,4 +114,4 @@ describe('CLI Integration', () => {
141114
expect(result).toBeDefined();
142115
});
143116
});
144-
});
117+
});

src/__tests__/integration/e2e/full-session.test.ts

Lines changed: 44 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
*/
55

66
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
7-
import { TestEnvironment, TestSession, ActivityRecord } from '../helpers/test-environment.js';
8-
import { generateTestFrames, generateSearchQueries } from '../fixtures/test-data-generator.js';
7+
import {
8+
TestEnvironment,
9+
TestSession,
10+
ActivityRecord,
11+
} from '../helpers/test-environment.js';
12+
import {
13+
generateTestFrames,
14+
generateSearchQueries,
15+
} from '../fixtures/test-data-generator.js';
916

1017
describe('Full Session Lifecycle', () => {
1118
let env: TestEnvironment;
@@ -24,13 +31,13 @@ describe('Full Session Lifecycle', () => {
2431
const project = await env.createProject('test-app');
2532
expect(project.id).toContain('e2e-test-project');
2633
expect(project.path).toContain('test-app');
27-
34+
2835
// Step 2: Start development session
2936
const session = await env.startSession('dev-session-1');
3037
expect(session).toBeDefined();
3138
expect(session.frameManager).toBeDefined();
3239
expect(session.sharedContext).toBeDefined();
33-
40+
3441
// Step 3: Record development activities
3542
const activities: ActivityRecord[] = [
3643
{ type: 'file_edit', file: 'src/app.ts' },
@@ -39,28 +46,28 @@ describe('Full Session Lifecycle', () => {
3946
{ type: 'test_run', status: 'pass' },
4047
{ type: 'commit', message: 'Fix test failures' },
4148
];
42-
49+
4350
const frameIds = await session.recordActivity(activities);
4451
expect(frameIds).toHaveLength(5);
45-
52+
4653
// Step 4: Save context before clear
4754
const savedContext = await session.saveContext();
4855
expect(savedContext.frames).toHaveLength(5);
4956
expect(savedContext.sessionId).toBe('dev-session-1');
50-
57+
5158
// Step 5: Simulate Claude clear
5259
await env.simulateClear();
53-
60+
5461
// Step 6: Restore context after clear
5562
const restoredContext = await env.restoreContext('dev-session-1');
5663
expect(restoredContext.frames).toHaveLength(5);
5764
expect(restoredContext.sessionId).toBe('dev-session-1');
58-
65+
5966
// Verify frame content preserved
6067
const firstFrame = restoredContext.frames[0];
6168
expect(firstFrame.name).toContain('Edit');
6269
expect(firstFrame.type).toBe('operation');
63-
70+
6471
// Step 7: Generate handoff document
6572
const handoff = await session.generateHandoff();
6673
expect(handoff).toContain('# Session Handoff');
@@ -76,36 +83,36 @@ describe('Full Session Lifecycle', () => {
7683
{ type: 'file_edit', file: 'api.ts' },
7784
{ type: 'command', command: 'npm test' },
7885
]);
79-
86+
8087
const contextA = await sessionA.saveContext();
8188
expect(contextA.frames).toHaveLength(2);
82-
89+
8390
// Session B reads and extends context
8491
const sessionB = await env.startSession('session-b');
85-
92+
8693
// Session B should be able to query Session A's frames
8794
const retriever = sessionB.retriever;
8895
const searchResult = await retriever.retrieveContext({
8996
text: 'api.ts',
9097
maxResults: 5,
9198
});
92-
99+
93100
expect(searchResult.contexts.length).toBeGreaterThan(0);
94101
expect(searchResult.contexts[0].frame.name).toContain('api.ts');
95-
102+
96103
// Session B adds more work
97104
await sessionB.recordActivity([
98105
{ type: 'file_edit', file: 'api.test.ts' },
99106
{ type: 'test_run', status: 'pass' },
100107
]);
101-
108+
102109
const contextB = await sessionB.saveContext();
103110
expect(contextB.frames.length).toBeGreaterThanOrEqual(2);
104111
});
105112

106113
it('should handle error recovery workflow', async () => {
107114
const session = await env.startSession('error-recovery');
108-
115+
109116
// Simulate error scenario
110117
const activities: ActivityRecord[] = [
111118
{ type: 'command', command: 'npm run build' },
@@ -114,24 +121,24 @@ describe('Full Session Lifecycle', () => {
114121
{ type: 'command', command: 'npm run build' },
115122
{ type: 'test_run', status: 'pass' },
116123
];
117-
124+
118125
const frameIds = await session.recordActivity(activities);
119-
126+
120127
// Verify error was recorded
121128
const db = await env.getDatabase();
122129
const errorFrame = await db.getFrame(frameIds[1]);
123130
expect(errorFrame?.type).toBe('error');
124131
expect(errorFrame?.state).toBe('error');
125-
132+
126133
// Search for error patterns
127134
const errorSearch = await session.retriever.retrieveContext({
128135
text: 'build failed',
129136
maxResults: 10,
130137
});
131-
138+
132139
expect(errorSearch.contexts.length).toBeGreaterThan(0);
133140
expect(errorSearch.contexts[0].frame.digest_text).toContain('Build failed');
134-
141+
135142
// Generate handoff should include error context
136143
const handoff = await session.generateHandoff();
137144
expect(handoff).toContain('[error]');
@@ -141,7 +148,7 @@ describe('Full Session Lifecycle', () => {
141148
it('should handle large session with many frames', async () => {
142149
const session = await env.startSession('large-session');
143150
const db = await env.getDatabase();
144-
151+
145152
// Generate many activities
146153
const activities: ActivityRecord[] = [];
147154
for (let i = 0; i < 100; i++) {
@@ -151,10 +158,10 @@ describe('Full Session Lifecycle', () => {
151158
status: i % 3 === 0 ? 'fail' : 'pass',
152159
});
153160
}
154-
161+
155162
const frameIds = await session.recordActivity(activities);
156163
expect(frameIds).toHaveLength(100);
157-
164+
158165
// Test search performance
159166
const startTime = Date.now();
160167
const searchResult = await db.search({
@@ -163,25 +170,25 @@ describe('Full Session Lifecycle', () => {
163170
limit: 20,
164171
});
165172
const searchTime = Date.now() - startTime;
166-
173+
167174
expect(searchResult.length).toBeLessThanOrEqual(20);
168175
expect(searchTime).toBeLessThan(100); // Should be fast
169-
176+
170177
// Test context retrieval with large dataset
171178
const queries = generateSearchQueries();
172179
for (const query of queries.slice(0, 5)) {
173180
const result = await session.retriever.retrieveContext({
174181
text: query,
175182
maxResults: 10,
176183
});
177-
184+
178185
expect(result.retrievalTimeMs).toBeLessThan(200);
179186
}
180187
});
181188

182189
it('should handle workflow transitions', async () => {
183190
const session = await env.startSession('workflow-test');
184-
191+
185192
// Start TDD workflow
186193
await session.recordActivity([
187194
{ type: 'command', command: 'stackmemory workflow start tdd' },
@@ -191,39 +198,19 @@ describe('Full Session Lifecycle', () => {
191198
{ type: 'test_run', status: 'pass' },
192199
{ type: 'file_edit', file: 'src/feature.ts' }, // Refactor
193200
]);
194-
201+
195202
// Save workflow state
196203
const context = await session.saveContext();
197204
expect(context.frames).toHaveLength(6);
198-
205+
199206
// Verify workflow pattern detected
200207
const frames = context.frames;
201-
const hasTestFirst = frames.some(f => f.name.includes('test') && f.state === 'completed');
202-
const hasImplementation = frames.some(f => f.name.includes('feature.ts'));
203-
208+
const hasTestFirst = frames.some(
209+
(f) => f.name.includes('test') && f.state === 'completed'
210+
);
211+
const hasImplementation = frames.some((f) => f.name.includes('feature.ts'));
212+
204213
expect(hasTestFirst).toBe(true);
205214
expect(hasImplementation).toBe(true);
206215
});
207-
208-
it.skip('should handle CLI commands integration - needs separate setup', async () => {
209-
// Test CLI commands in the environment
210-
211-
// Initialize via CLI
212-
const initOutput = await env.runCLICommand('init');
213-
expect(initOutput).toContain('StackMemory initialized');
214-
215-
// Check status
216-
const statusOutput = await env.runCLICommand('status');
217-
expect(statusOutput).toContain('StackMemory Status');
218-
219-
// Test workflow commands
220-
const workflowList = await env.runCLICommand('workflow --list');
221-
expect(workflowList).toContain('Available Workflows');
222-
expect(workflowList).toContain('tdd');
223-
expect(workflowList).toContain('feature');
224-
225-
// Test clear status
226-
const clearStatus = await env.runCLICommand('clear --status');
227-
expect(clearStatus).toContain('Context Usage');
228-
});
229-
});
216+
});

src/cli/commands/__tests__/integration.test.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,6 @@ describe('CLI Integration Tests', () => {
4747
expect(result).toContain('Context Usage Status');
4848
expect(result).toContain('Usage:');
4949
});
50-
51-
it.skip('should save continuity ledger - NEEDS IMPLEMENTATION', () => {
52-
const result = execSync(cli('clear --save'), {
53-
cwd: testDir,
54-
encoding: 'utf8',
55-
});
56-
57-
expect(result).toContain('Continuity ledger saved');
58-
59-
// Check that ledger file was created
60-
const ledgerPath = path.join(testDir, '.stackmemory', 'continuity.json');
61-
expect(fs.existsSync(ledgerPath)).toBe(true);
62-
});
63-
64-
it.skip('should restore from ledger - NEEDS IMPLEMENTATION', () => {
65-
// First save a ledger
66-
execSync(cli('clear --save'), { cwd: testDir });
67-
68-
// Then restore
69-
const result = execSync(cli('clear --restore'), {
70-
cwd: testDir,
71-
encoding: 'utf8',
72-
});
73-
74-
expect(result).toContain('restored');
75-
});
7650
});
7751

7852
describe('Workflow Commands', () => {
@@ -166,33 +140,4 @@ describe('CLI Integration Tests', () => {
166140
expect(result).toBeDefined();
167141
});
168142
});
169-
170-
describe('Feature Integration', () => {
171-
it.skip('should handle full workflow - NEEDS IMPLEMENTATION', () => {
172-
// Start a workflow
173-
let result = execSync(cli('workflow --start tdd'), {
174-
cwd: testDir,
175-
encoding: 'utf8',
176-
});
177-
178-
expect(result).toContain('workflow');
179-
180-
// Generate handoff
181-
result = execSync(cli('handoff capture'), {
182-
cwd: testDir,
183-
encoding: 'utf8',
184-
});
185-
186-
// Just verify it ran
187-
expect(result).toBeDefined();
188-
189-
// Save and clear
190-
result = execSync(cli('clear --save'), {
191-
cwd: testDir,
192-
encoding: 'utf8',
193-
});
194-
195-
expect(result).toContain('Continuity ledger saved');
196-
});
197-
});
198143
});

0 commit comments

Comments
 (0)