feat: Convert factories files to JS
This commit is contained in:
15
packages/backend/test/factories/execution.js
Normal file
15
packages/backend/test/factories/execution.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { createFlow } from './flow';
|
||||
|
||||
export const createExecution = async (params = {}) => {
|
||||
params.flowId = params?.flowId || (await createFlow()).id;
|
||||
params.testRun = params?.testRun || false;
|
||||
params.createdAt = params?.createdAt || new Date().toISOString();
|
||||
params.updatedAt = params?.updatedAt || new Date().toISOString();
|
||||
|
||||
const [execution] = await global.knex
|
||||
.table('executions')
|
||||
.insert(params)
|
||||
.returning('*');
|
||||
|
||||
return execution;
|
||||
};
|
Reference in New Issue
Block a user