mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat: Add support for AI log streaming (#8526)
Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
34
packages/cli/test/unit/ExecutionMetadataService.test.ts
Normal file
34
packages/cli/test/unit/ExecutionMetadataService.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Container } from 'typedi';
|
||||
import { ExecutionMetadataRepository } from '@db/repositories/executionMetadata.repository';
|
||||
import { ExecutionMetadataService } from '@/services/executionMetadata.service';
|
||||
import { mockInstance } from '../shared/mocking';
|
||||
|
||||
describe('ExecutionMetadataService', () => {
|
||||
const repository = mockInstance(ExecutionMetadataRepository);
|
||||
|
||||
test('Execution metadata is saved in a batch', async () => {
|
||||
const toSave = {
|
||||
test1: 'value1',
|
||||
test2: 'value2',
|
||||
};
|
||||
const executionId = '1234';
|
||||
|
||||
await Container.get(ExecutionMetadataService).save(executionId, toSave);
|
||||
|
||||
expect(repository.save).toHaveBeenCalledTimes(1);
|
||||
expect(repository.save.mock.calls[0]).toEqual([
|
||||
[
|
||||
{
|
||||
execution: { id: executionId },
|
||||
key: 'test1',
|
||||
value: 'value1',
|
||||
},
|
||||
{
|
||||
execution: { id: executionId },
|
||||
key: 'test2',
|
||||
value: 'value2',
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user