The smartest thing I came up to so far is to copy the text from the card template and open it as an html file in my IDE. Unfortunately, I need to use mocked data for the fields, also there’s no Anki to generate an input for my free-form answer cards.
I wonder if someone came up with better solution.
Also, another question: how do you test if your card with JS will work on mobile platforms? Which browser is used inside AnkiDroid, AnkiOSX, AnkiWindows, AnkiLinux, and Anki for iPhone?
No substitute for testing on real devices. I’ve had issues with even simple templates with basic JS not working properly on mobile for example.
But knowing the browsers/web engines used on each platform is definitely helpful if you want to see if some feature you want to use is supported everywhere (MDN and caniuse are popular resources for that). The following web engines are used on each platform: