Jingle bells, jingle bells, jingle all the way
Oh what fun it is to write a unit test today…
We’re excited to announce that unit testing with the Canva Apps SDK is now simple and straightforward!
The Canva Apps SDK is awesome because it puts the power of the Canva editor in your app, but less awesome outside the editor - the APIs have nothing to call and things break. We have now made it possible to run apps in a test environment while calling our APIs! That means you can mock and spy on them in unit tests. We’ve sprinkled some starter magic in our templates for you to play with and expand - the sky’s the limit!
expect(isMerryChristmas).toBe(true);
Instructions:
- Start a new project by following the quickstart guide - all new apps are created with jest set up for running unit tests and some example tests included,
or - Add tests to an existing project by following the new unit testing guide
or - Look at the unit_testing example in the starter kit
There will be more developer
presents
every day this week, stay tuned for the next drop!