Skip to main content
Best answer

Mocking framework

  • May 2, 2023
  • 1 reply
  • 159 views

Forum|alt.badge.img+1

When I convert an integration, using zapier convert, it creates a node.js project that uses mocha and shoutd.

I’d like to add unit tests that use mocking rather than actual connections to the remote service (a REST API).

Which mocking framework would you suggest?  Do you have any examples of this?

Best answer by MarinaHBest answer by MarinaH

Hey @benjamink9 👋
 

Nock is recommended and there’s an example in our docs here: https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#mocking-requests 

Hope that helps get you started!

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Forum|alt.badge.img+9
  • Zapier Staff
  • 238 replies
  • Answer
  • May 3, 2023

Hey @benjamink9 👋
 

Nock is recommended and there’s an example in our docs here: https://github.com/zapier/zapier-platform/blob/main/packages/cli/README.md#mocking-requests 

Hope that helps get you started!