I am trying to test my job using the testing library/package - https://github.com/triggerdotdev/trigger.dev/tree/main/packages/testing
I have a task to insert rows into supabase as below.
const { error } = await io.supabase.runTask("push_history", async () =>
await io.supabase.client
.from('inverter_history')
.insert(history),
{ retry }
);
in my test i have specified the return value
const testRun = await testJob(history, {
payload: {
date: "2023-07-19 11:00"
},
tasks: {
push_history: {
}
}
});
If I check to make sure the task was called, the below code works
expect(testRun.tasks["push_history"]).toHaveBeenCalledOnce();
if i try and check that the task was called with values i always get undefined
expect(testRun.tasks["push_history"]).toHaveBeenCalledWith(
What should go here?
);
if i test the returned results for other supabase fetches this works, there seems to be issues with the input checks.