Skip to main content
Question

How to write unit test cases for Figma codegen Plugin?


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?

2 replies

y_toku
Figmate
  • Community Support
  • 2518 replies
  • 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
  • 31 replies
  • 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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings