diff --git a/packages/backend/test/factories/execution.ts b/packages/backend/test/factories/execution.ts new file mode 100644 index 00000000..84748831 --- /dev/null +++ b/packages/backend/test/factories/execution.ts @@ -0,0 +1,14 @@ +import Execution from '../../src/models/execution'; +import { createFlow } from './flow'; + +export const createExecution = async (params: Partial = {}) => { + params.flowId = params?.flowId || (await createFlow()).id; + params.testRun = params?.testRun || false; + + const [execution] = await global.knex + .table('execution') + .insert(params) + .returning('*'); + + return execution; +};