The best way to learn how to use the Tester API and see it in action is probably to have a look at CasperJS’ own test suites.
Thanks for this quote, I found that using the
fs module one can load local filesystem files as modules to be used. Using that now I could write unit tests while developing the library and later on write functional tests while using the library.
Here is the file structure
library --test |--unit |--test.js |--index.html --src |--livetransit.js
And here is are the two tests – i) uses a webpage based approach; ii) uses module approach