yaru22 / ng-html2js

Standalone script to turn Angular template into js and put it in a module.
32 stars 19 forks source link

Add jasmine tests #7

Closed mikeymc closed 9 years ago

mikeymc commented 9 years ago

In response to #5

We switched from mocha to jasmine for testing, and characterized the behavior of ng-html2js in a suite of acceptance tests. We noticed, while going through this exercise, that ng-html2js behaves in some unexpected ways, particularly around the baseDir feature. For this pull request, we did not modify any of the tool's existing behavior. We would be happy to do so in a later pull request if warranted.

Previous to this pull request, there were two mocha tests that only tested html2js(), the function that is wrapped by ng-html2js. We also noticed that, upon forking, both of those tests failed and we could not figure out how to easily get them passing. Given we work at Pivotal Labs and we love Jasmine, we just switched over to Jasmine, ported over the existing two tests, and added several more. We are testing the external interface of the application by hitting it from the outside via shell commands rather than by only testing the inner function, html2js().

mikeymc commented 9 years ago

We noticed you have a CI environment that is trying to use mocha. The new test suite can be run by doing an npm install, which will pull down jasmine, then running './node_modules/.bin/jasmine'

yaru22 commented 9 years ago

Awesome PR. Thanks for your contribution @mikeymc. I'll change Travis CI settings to use jasmine as well.