I am trying to write a unit test on a trigger that calls
z.cursor and the first issue I ran into was I need to set environment variables for
ZAPIER_DEPLOY_KEY after doing that I get the following error:
only absolute urls are supported
which is referring to
z.cursor.get() . Im guessing this is due to the fact that the function is using relative pathing but I am unsure how to move forward. Is there a way to mock out this call so that the test can continue?
Best answer by ikbelkirasanView original
@Raman - If you’re using Jest to run your tests, try mocking the z.cursor.get and z.cursor.set functions before calling the trigger’s perform function. Here’s an example showing how I do it: