Files
automatisch/packages/backend/test/factories/execution.ts
2023-10-23 22:52:24 +02:00

15 lines
402 B
TypeScript

import Execution from '../../src/models/execution';
import { createFlow } from './flow';
export const createExecution = async (params: Partial<Execution> = {}) => {
params.flowId = params?.flowId || (await createFlow()).id;
params.testRun = params?.testRun || false;
const [execution] = await global.knex
.table('execution')
.insert(params)
.returning('*');
return execution;
};