Skip to main content

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?

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


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