create mock task id

Signed-off-by: Fabio Vincenzi <fabio.vincenzi2001@gmail.com>
This commit is contained in:
Fabio Vincenzi
2024-12-16 11:30:41 +01:00
parent 372a4cac0d
commit 6ea0d2f1a5
@@ -45,6 +45,9 @@ export const createMockActionContext = <
input: {} as TActionInput,
checkpoint: jest.fn(),
getInitiatorCredentials: () => Promise.resolve(credentials),
task: {
id: 'mock-task-id',
},
};
const createDefaultWorkspace = () => ({
@@ -58,8 +61,15 @@ export const createMockActionContext = <
};
}
const { input, logger, logStream, secrets, templateInfo, workspacePath } =
options;
const {
input,
logger,
logStream,
secrets,
templateInfo,
workspacePath,
task,
} = options;
return {
...defaultContext,
@@ -71,6 +81,7 @@ export const createMockActionContext = <
...(logStream && { logStream }),
...(input && { input }),
...(secrets && { secrets }),
...(task && { task }),
templateInfo,
};
};