Skip to content

Commit 090035d

Browse files
committed
test(storage): enforce managed source drift rejection
1 parent f9aa2a5 commit 090035d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎packages/storage/src/__tests__/git-workspace-service.test.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe('Git workspace service', () => {
157157
assert.equal((await restarted.inspectManagedWorkspace(adopted)).state, 'ready');
158158
});
159159

160-
test('reopens an existing managed epoch after the source checkout advances', async () => {
160+
test('rejects reopening an existing managed epoch after the source checkout advances', async () => {
161161
const root = await temporaryRoot();
162162
const sourceRoot = await createEligibleSource(join(root, 'source'));
163163
const storageRoot = join(root, 'storage');
@@ -180,11 +180,10 @@ describe('Git workspace service', () => {
180180
);
181181

182182
const restarted = await serviceAt(storageRoot);
183-
const reopened = await restarted.openManagedWorkspaceFromBinding(created);
184-
185-
assert.deepEqual(reopened, created);
186-
assert.equal((await restarted.inspectManagedWorkspace(reopened)).state, 'ready');
187-
assert.equal(await readFile(join(reopened.worktreePath, 'tracked.txt'), 'utf8'), 'tracked\n');
183+
await assert.rejects(
184+
restarted.openManagedWorkspaceFromBinding(created),
185+
isWorkspaceError('managed_workspace_source_drifted'),
186+
);
188187
});
189188

190189
test('creates a second epoch with a different baseline in the same managed repository', async () => {

0 commit comments

Comments
 (0)