mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(core): Increase Cron observability (#17626)
This commit is contained in:
@@ -24,6 +24,17 @@ import {
|
||||
type Workflow,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
const logger = mock({
|
||||
scoped: jest.fn().mockReturnValue(
|
||||
mock({
|
||||
debug: jest.fn(),
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
type MockDeepPartial<T> = Parameters<typeof mock<T>>[0];
|
||||
|
||||
type TestTriggerNodeOptions = {
|
||||
@@ -70,7 +81,11 @@ export async function testTriggerNode(
|
||||
) as INode;
|
||||
const workflow = mock<Workflow>({ timezone: options.timezone ?? 'Europe/Berlin' });
|
||||
|
||||
const scheduledTaskManager = new ScheduledTaskManager(mock<InstanceSettings>());
|
||||
const scheduledTaskManager = new ScheduledTaskManager(
|
||||
mock<InstanceSettings>(),
|
||||
logger as any,
|
||||
mock(),
|
||||
);
|
||||
const helpers = mock<ITriggerFunctions['helpers']>({
|
||||
createDeferredPromise,
|
||||
returnJsonArray,
|
||||
@@ -130,7 +145,11 @@ export async function testWebhookTriggerNode(
|
||||
) as INode;
|
||||
const workflow = mock<Workflow>({ timezone: options.timezone ?? 'Europe/Berlin' });
|
||||
|
||||
const scheduledTaskManager = new ScheduledTaskManager(mock<InstanceSettings>());
|
||||
const scheduledTaskManager = new ScheduledTaskManager(
|
||||
mock<InstanceSettings>(),
|
||||
logger as any,
|
||||
mock(),
|
||||
);
|
||||
const helpers = mock<ITriggerFunctions['helpers']>({
|
||||
returnJsonArray,
|
||||
registerCron: (cronExpression, onTick) =>
|
||||
|
||||
Reference in New Issue
Block a user