-
Notifications
You must be signed in to change notification settings - Fork 41
Description
I have worked a little bit on the library (see #13) and it would have been super helpful to have a suite of tests to be sure that I was not breaking anything during the refactoring. I want to collect here some ideas, to see if we can come up with something that can be useful.
Jest testing + Mocks
Potentially we could use Jest to test the API calls (using mocks for the API responses), even if I am not 100% sure how much this would be helpful (eg. we would not notice a change a break in the code if Figma updates their APIs, because we're mocking them). Any ideas of possible workaround or approaches for testing API interfaces?
Figma file
We could have a Figma file (.fig
) attached to repo, that one can import and then, updating the file ID/key in a specific file, one can run a set of tests against that file (eg. during the development I created a script that listed/posted/deleted comments to a file). Of course, we can't test every API method (eg. we would need a team) but maybe a subset of calls could be tested directly using the real Figma APIs (we test the requests me make, we tests the responses we receive). We could even go further, and create a Figma user (with an email owned by @Morglod) with a base license (in that case I suppose you can test even more calls).
Any other ideas, suggestions?
/cc @honzatmn maybe you have also some ideas :)