lasso-node
v0.1.13
Published
JavaScript widget and page unit testing with on the fly instrumentation
Downloads
190
Maintainers
Readme
lasso
JavaScript widget and page unit testing with on the fly instrumentation
installation
npm install -g lasso-node
Install phantomjs (version 1.8 or higher is recommended), it should be in the path.
30 second example
Open examples\basic\foo.html in a browser. It should load foo.js, fooTests.js but report no coverage.
From command line run lasso on foo.html
lasso-node foo.html
Lasso starts a local webserver, starts phantomjs, runs the foo.html through the phantomjs. When phantomjs is asking for a .js file, lasso loads the js, instruments using istanbul and serves the instrumented version. Thus javascript code coverage is computed absolutely transparently to the testing code. After phantomjs is done, it saved the coverage object into a json file. Node then creates several reports: console and html. The html reports are very detailed, please take a look at them inside folder cover.
Options
Use -h or --help command line switch to see all available options
Main ones:
- --jsunity - filters a few jsunity library js files to avoid instrumenting 3rd party tools
- --serve - start the webserver and wait, you can then open http://localhost:8888/foo.html in any browser to see what phantomjs is running.
Contact
Please contact me, Gleb Bahmutov at [email protected] with any comments, questions or suggestions.
License
MIT license, see included file. You can do pretty much anything except claim code ownership or sue me if there are problems ;)