Skip to main content
May 9, 2024
Question

How to write unit test cases for Figma codegen Plugin?

  • May 9, 2024
  • 2 replies
  • 496 views

i am creating a codegen plugin to generate code from Figma design. i would like to write some unit test cases for it? how i can do this using jest?

This topic has been closed for replies.

2 replies

y_toku
Figmate
Community Support
May 13, 2024

Hi there,

Thanks for reaching out. I hope other community members jump in this thread to share their insights! I’ll do some digging on my end to see if I can find any resources that might be beneficial to you.

Thanks,
Toku

Gavin
Active Member
April 8, 2025

Hi. Running unit tests that involve using Figma’s api isn’t straight forward. If you just need to test functions that don’t use the Figma API you can use any JS testing framework. However if you want to run unit tests against Figma’s API then you might be interested in a toolkit I’ve created. The next release has a command for running unit tests. You can checkout the toolkit at https://www.plugma.dev/. If you’re interested in the testing feature just let me know.