fix(memory): resolve Vitest false positive for expected rejection (#3893)
Wrap the addObservations call in an async closure before asserting with .rejects.toThrow(). This prevents Vitest's global unhandled rejection handler from capturing the expected error before the assertion can intercept it, eliminating the false-positive "Unhandled Errors" warning that was failing CI. Fixes #3073
This commit is contained in:
parent
2e3e4c7ab7
commit
cce08de417
1 changed files with 4 additions and 4 deletions
|
|
@ -146,11 +146,11 @@ describe('KnowledgeGraphManager', () => {
|
|||
});
|
||||
|
||||
it('should throw error for non-existent entity', async () => {
|
||||
await expect(
|
||||
manager.addObservations([
|
||||
await expect(async () => {
|
||||
await manager.addObservations([
|
||||
{ entityName: 'NonExistent', contents: ['some observation'] },
|
||||
])
|
||||
).rejects.toThrow('Entity with name NonExistent not found');
|
||||
]);
|
||||
}).rejects.toThrow('Entity with name NonExistent not found');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue