Skip to content

Commit db92d48

Browse files
author
StackMemory Bot (CLI)
committed
fix(test): add timeout to execSync calls in cli-integration tests
Prevents potential hangs from missing timeout parameter.
1 parent 203512e commit db92d48

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe('CLI Integration', { timeout: 60_000 }, () => {
3333
it('should show help', () => {
3434
const result = execSync(`node ${cliPath} --help`, {
3535
encoding: 'utf8',
36+
timeout: 15_000,
3637
});
3738

3839
expect(result).toContain('stackmemory');
@@ -42,6 +43,7 @@ describe('CLI Integration', { timeout: 60_000 }, () => {
4243
it('should show version', () => {
4344
const result = execSync(`node ${cliPath} --version`, {
4445
encoding: 'utf8',
46+
timeout: 15_000,
4547
});
4648

4749
expect(result).toMatch(/\d+\.\d+\.\d+/);
@@ -51,6 +53,7 @@ describe('CLI Integration', { timeout: 60_000 }, () => {
5153
const result = execSync(`node ${cliPath} init`, {
5254
cwd: testDir,
5355
encoding: 'utf8',
56+
timeout: 15_000,
5457
});
5558

5659
expect(result).toContain('StackMemory initialized');
@@ -67,6 +70,7 @@ describe('CLI Integration', { timeout: 60_000 }, () => {
6770
execSync(`node ${cliPath} status`, {
6871
cwd: testDir,
6972
encoding: 'utf8',
73+
timeout: 15_000,
7074
});
7175
} catch (error: any) {
7276
expect(error.stdout || error.message).toContain('not initialized');

0 commit comments

Comments
 (0)