Skip to content

Commit 98b220e

Browse files
Update test/storage/store.test.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent effe803 commit 98b220e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/storage/store.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ describe('Store', () => {
4646

4747
it('should not create missing zvec in read-only mode', () => {
4848
const readOnlyStore = new Store(testDir, embedder, { readOnly: true });
49-
expect(() => readOnlyStore.acquireZvec('missing-lib', 'jieba')).toThrow(/read-only mode/);
50-
expect(fs.existsSync(path.join(testDir, 'missing-lib.zvec'))).toBe(false);
51-
readOnlyStore.close();
49+
try {
50+
expect(() => readOnlyStore.acquireZvec('missing-lib', 'jieba')).toThrow(/read-only mode/);
51+
expect(fs.existsSync(path.join(testDir, 'missing-lib.zvec'))).toBe(false);
52+
} finally {
53+
readOnlyStore.close();
54+
}
5255
});
5356
});
5457

0 commit comments

Comments
 (0)