Skip to content

Commit 1f8cb32

Browse files
committed
mock db calls to prevent type errors
1 parent c1f8cdd commit 1f8cb32

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/cli/src/services/__tests__/workflow-statistics.service.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ describe('WorkflowStatisticsService', () => {
8181
test.each<WorkflowExecuteMode>(['cli', 'error', 'retry', 'trigger', 'webhook', 'evaluation'])(
8282
'should upsert with root executions for execution mode %s',
8383
async (mode) => {
84+
mockDBCall();
8485
// Call the function with a production success result, ensure metrics hook gets called
8586
const runData: IRun = {
8687
finished: true,
@@ -103,6 +104,7 @@ describe('WorkflowStatisticsService', () => {
103104
test.each<WorkflowExecuteMode>(['manual', 'integrated', 'internal'])(
104105
'should upsert without root executions for execution mode %s',
105106
async (mode) => {
107+
mockDBCall();
106108
const runData: IRun = {
107109
finished: true,
108110
status: 'success',
@@ -124,6 +126,7 @@ describe('WorkflowStatisticsService', () => {
124126
test.each<ExecutionStatus>(['success', 'crashed', 'error'])(
125127
'should upsert with root executions for execution status %s',
126128
async (status) => {
129+
mockDBCall();
127130
const runData: IRun = {
128131
finished: true,
129132
status,
@@ -145,6 +148,7 @@ describe('WorkflowStatisticsService', () => {
145148
test.each<ExecutionStatus>(['canceled', 'new', 'running', 'unknown', 'waiting'])(
146149
'should upsert without root executions for execution status %s',
147150
async (status) => {
151+
mockDBCall();
148152
const runData: IRun = {
149153
finished: true,
150154
status,
@@ -194,6 +198,7 @@ describe('WorkflowStatisticsService', () => {
194198
});
195199

196200
test('should only create metrics for production successes', async () => {
201+
mockDBCall();
197202
// Call the function with a non production success result, ensure metrics hook is never called
198203
const workflow = {
199204
id: '1',

0 commit comments

Comments
 (0)