Skip to content

Commit 7ef68a6

Browse files
committed
fix: tmp file leak
1 parent 9a6ac15 commit 7ef68a6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎test/context.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ describe('Context', () => {
4343
describe('load', () => {
4444
it('should call onProgress callback during load', async () => {
4545
const progressCalls: { phase: string; detail: { loaded: number; total: number } }[] = [];
46+
const progressDir = TEST_DIR + '-progress';
4647

4748
const ctxWithProgress = await Context.create({
48-
vectorsDir: TEST_DIR + '-progress',
49+
vectorsDir: progressDir,
4950
onProgress: (phase, detail) => {
5051
progressCalls.push({ phase, detail });
5152
},
@@ -57,6 +58,11 @@ describe('Context', () => {
5758
expect(progressCalls.map(c => c.phase)).toContain('load');
5859

5960
await ctxWithProgress.close();
61+
62+
// Cleanup
63+
if (fs.existsSync(progressDir)) {
64+
fs.rmSync(progressDir, { recursive: true, force: true });
65+
}
6066
});
6167

6268
it('should load markdown files', async () => {

0 commit comments

Comments
 (0)