Skip to content

Commit 732b2b8

Browse files
committed
minor nits
1 parent da8fb50 commit 732b2b8

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

packages/sandbox-container/tests/session.test.ts

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Session', () => {
7676
expect(session.isReady()).toBe(true);
7777
});
7878

79-
it('should fall back to home directory when cwd does not exist (issue #288)', async () => {
79+
it('should fall back to home directory when cwd does not exist', async () => {
8080
// Session cwd only affects shell startup directory - it's not critical.
8181
// If cwd doesn't exist, we fall back to the home directory since individual
8282
// commands can specify their own cwd anyway.
@@ -97,8 +97,8 @@ describe('Session', () => {
9797
expect(result.stdout.trim()).toBe(homeDir);
9898
});
9999

100-
it('should fall back to home directory when workspace is deleted before session creation (issue #288)', async () => {
101-
// Simulate the exact scenario from issue #288
100+
it('should fall back to home directory when workspace is deleted before session creation', async () => {
101+
// Simulate the scenario where workspace is deleted before session creation
102102
// Create a workspace, then delete it, then try to create a session with it
103103
const workspaceDir = join(testDir, 'workspace');
104104
await mkdir(workspaceDir, { recursive: true });
@@ -544,7 +544,7 @@ describe('Session', () => {
544544
expect(result.stderr).toContain('Failed to change directory');
545545
});
546546

547-
it('should continue working after session cwd is deleted (issue #288)', async () => {
547+
it('should continue working after session cwd is deleted', async () => {
548548
// Create a working directory for the session
549549
const workspaceDir = join(testDir, 'workspace');
550550
await mkdir(workspaceDir, { recursive: true });
@@ -574,7 +574,7 @@ describe('Session', () => {
574574
expect(afterRemoval.stdout.trim()).toBe('after removal');
575575
});
576576

577-
it('should handle cwd being replaced with symlink (issue #288)', async () => {
577+
it('should handle cwd being replaced with symlink', async () => {
578578
// Create directories for the test
579579
const workspaceDir = join(testDir, 'workspace');
580580
const backupDir = join(testDir, 'backup');
@@ -603,32 +603,6 @@ describe('Session', () => {
603603
expect(afterSymlink.exitCode).toBe(0);
604604
expect(afterSymlink.stdout.trim()).toBe('after symlink');
605605
});
606-
607-
it('should be recoverable by cd-ing to valid directory after cwd deletion', async () => {
608-
// Create a working directory for the session
609-
const workspaceDir = join(testDir, 'workspace');
610-
await mkdir(workspaceDir, { recursive: true });
611-
612-
session = new Session({
613-
id: 'test-cwd-recovery',
614-
cwd: workspaceDir
615-
});
616-
617-
await session.initialize();
618-
619-
// Delete the workspace directory
620-
await session.exec(`rm -rf ${workspaceDir}`);
621-
622-
// Change to a valid directory - this should work and recover the session
623-
const cdResult = await session.exec('cd /tmp && pwd');
624-
expect(cdResult.exitCode).toBe(0);
625-
expect(cdResult.stdout.trim()).toBe('/tmp');
626-
627-
// Subsequent commands should work
628-
const afterCd = await session.exec('echo "recovered"');
629-
expect(afterCd.exitCode).toBe(0);
630-
expect(afterCd.stdout.trim()).toBe('recovered');
631-
});
632606
});
633607

634608
describe('FIFO cleanup', () => {

0 commit comments

Comments
 (0)