shish/shimmie2

JS Testing

Opened this issue · 0 comments

Shimmie isn't super-js-heavy in general, but a few extensions are (notes, autocomplete) - it'd be nice to have some tests for those

Seems like most JS testing frameworks assume you are using a full nodejs install, you can't just include the framework.js in your HTML headers. I can't even find a way to test a single .js file from the command line without a full node_modules / package.json / all that faff D:

A possible solution - have an extension which:

  • includes ext/*/test.js into the page headers
  • includes a small testing framework which calls whichever test suites were defined in test.js
  • displays results on the page

Maybe this is small enough that it could be DIY'ed? Define an assertEquals() function in ext/jstest/init.js, call it from ext/*/test.js, display results in ext/jstest/script.js?