Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-kellam committed Dec 17, 2024
1 parent ef48c01 commit 39e1e4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/backend/src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ vi.mock('glob', () => ({
glob: vi.fn().mockReturnValue(['fake_index.zoekt']),
}));

vi.mock('fs', () => ({
existsSync: vi.fn().mockReturnValue(true),
}));

const createMockContext = (rootPath: string = '/app') => {
return {
configPath: path.join(rootPath, 'config.json'),
Expand Down Expand Up @@ -159,7 +163,7 @@ test('deleteStaleRepository can delete a git repository', async () => {

await deleteStaleRepository(repo, db, ctx);

expect(db.data.repos['github.com/sourcebot-dev/sourcebot']).toBeUndefined();;
expect(db.data.repos['github.com/sourcebot-dev/sourcebot']).toBeUndefined();
expect(rm).toHaveBeenCalledWith(`${ctx.reposPath}/github.com/sourcebot-dev/sourcebot`, {
recursive: true,
});
Expand Down

0 comments on commit 39e1e4b

Please sign in to comment.