diff --git a/packages/cli/src/executions/__tests__/execution-persistence.test.ts b/packages/cli/src/executions/__tests__/execution-persistence.test.ts index 649332e510f..41cfa50b50f 100644 --- a/packages/cli/src/executions/__tests__/execution-persistence.test.ts +++ b/packages/cli/src/executions/__tests__/execution-persistence.test.ts @@ -215,22 +215,21 @@ describe('ExecutionPersistence', () => { const target = { workflowId: 'wf-1', executionId: 'exec-1', storedAt: 'db' as const }; it('should soft-delete with backdated `deletedAt` when pruning is enabled', async () => { + jest.useFakeTimers(); + const now = Date.now(); + executionsConfig.pruneData = true; executionsConfig.pruneDataHardDeleteBuffer = 1; const executionPersistence = createPersistenceService('db'); await executionPersistence.deleteInFlightExecution(target); - const after = Date.now(); expect(executionRepository.update).toHaveBeenCalledWith('exec-1', { - deletedAt: expect.any(Date), + deletedAt: new Date(now - 3600_000), }); - - const { deletedAt } = executionRepository.update.mock.calls[0][1] as { deletedAt: Date }; - // deletedAt should be backdated by ~1 hour (the buffer) - // Use `after` to tolerate clock progression between before/after snapshots - expect(deletedAt.getTime()).toBeLessThanOrEqual(after - 3600_000); expect(executionRepository.deleteByIds).not.toHaveBeenCalled(); + + jest.useRealTimers(); }); it('should hard-delete immediately when pruning is disabled', async () => { diff --git a/packages/frontend/editor-ui/src/features/shared/editors/plugins/codemirror/typescript/worker/typescript.worker.test.ts b/packages/frontend/editor-ui/src/features/shared/editors/plugins/codemirror/typescript/worker/typescript.worker.test.ts index 5f6336288f6..eb178e27481 100644 --- a/packages/frontend/editor-ui/src/features/shared/editors/plugins/codemirror/typescript/worker/typescript.worker.test.ts +++ b/packages/frontend/editor-ui/src/features/shared/editors/plugins/codemirror/typescript/worker/typescript.worker.test.ts @@ -5,6 +5,15 @@ import { mock } from 'vitest-mock-extended'; import type { WorkerInitOptions } from '../types'; import { worker } from './typescript.worker'; +vi.mock('@/app/plugins/cache', () => ({ + indexedDbCache: async () => ({ + getItem: () => '{}', + setItem: () => {}, + removeItem: () => {}, + clear: () => {}, + getAllWithPrefix: async () => ({}), + }), +})); vi.mock('@typescript/vfs'); vi.mock('typescript', async (importOriginal) => { return await importOriginal(); diff --git a/packages/nodes-base/nodes/Google/Sheet/test/GoogleSheetsTrigger.test.ts b/packages/nodes-base/nodes/Google/Sheet/test/GoogleSheetsTrigger.test.ts index e00afc2d29a..fe58fa2896a 100644 --- a/packages/nodes-base/nodes/Google/Sheet/test/GoogleSheetsTrigger.test.ts +++ b/packages/nodes-base/nodes/Google/Sheet/test/GoogleSheetsTrigger.test.ts @@ -8,6 +8,18 @@ import { GoogleSheetsTrigger } from '../GoogleSheetsTrigger.node'; describe('GoogleSheetsTrigger', () => { const baseUrl = 'https://sheets.googleapis.com'; + beforeAll(() => { + nock.disableNetConnect(); + }); + + afterAll(() => { + nock.enableNetConnect(); + }); + + afterEach(() => { + nock.cleanAll(); + }); + describe('rowAdded event', () => { it('should return rows without header', async () => { const scope = nock(baseUrl);