mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-05 02:43:32 +00:00
fix(test): use importOriginal to avoid missing export errors in vi.mock
This commit is contained in:
parent
fd3669a1c4
commit
6f995e30fb
1 changed files with 7 additions and 3 deletions
|
|
@ -1,9 +1,13 @@
|
|||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { searchFTSFromLbug, type BM25SearchResult } from '../../src/core/search/bm25-index.js';
|
||||
|
||||
vi.mock('../../src/core/lbug/lbug-adapter.js', () => ({
|
||||
queryFTS: vi.fn().mockResolvedValue([]),
|
||||
}));
|
||||
vi.mock('../../src/core/lbug/lbug-adapter.js', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('../../src/core/lbug/lbug-adapter.js')>();
|
||||
return {
|
||||
...actual,
|
||||
queryFTS: vi.fn().mockResolvedValue([]),
|
||||
};
|
||||
});
|
||||
|
||||
describe('BM25 search', () => {
|
||||
describe('searchFTSFromLbug', () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue