Add tests

Adds a test suite :) 

~~I've also added some blank tests, assuming it should log errors if things break. If it would be better to move them to a separate PR with the code, that's fine.~~ I've added these as an issue.

Please review @perry and @incuna/js 
Add tests for when there are both `name` and `controller` values.