waterbearlang / waterbear

Visual block syntax for programming languages
http://waterbearlang.com/
357 stars 88 forks source link

Add code coverage report #1239

Closed alexjsmac closed 8 years ago

alexjsmac commented 8 years ago

Not ready to merge, just have a few questions/issues.

Since run_tests.sh is giving test/runtime.html as a parameter, is that what I should include as the test script in my.conf.js? Or should it be test/runtime.js?

// list of files / patterns to load in the browser
    files: [
      'js/runtime.js',
      'test/runtime.html'
    ],

With this configuration I get the following error when I run npm test:

Alex-MacLeans-MacBook-Pro:waterbear alexmaclean$ npm test

> waterbear@0.8.0 test /Users/alexmaclean/Development/waterbear
> ./node_modules/karma/bin/karma start my.conf.js

15 10 2015 23:18:04.732:INFO [karma]: Karma v0.13.11 server started at http://localhost:9876/
15 10 2015 23:18:04.744:INFO [launcher]: Starting browser PhantomJS
15 10 2015 23:18:06.803:INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket 8HZMnpN7LPauoxnXAAAA with id 88181536
PhantomJS 1.9.8 (Mac OS X 0.0.0) ERROR
  TypeError: 'undefined' is not a function (evaluating 'Event.on')
  at /Users/alexmaclean/Development/waterbear/js/runtime.js:9

npm ERR! Test failed.  See above for more details.

Not sure what's triggering the error :confused: .

alexjsmac commented 8 years ago

Oh and this is what I'm trying to do: http://ariya.ofilabs.com/2013/10/code-coverage-of-qunit-tests-using-istanbul-and-karma.html

dethe commented 8 years ago

I'm not sure how Istanbul works, but test/runtime.js is the testfile (so far) that we want to check to see how well it covers js/runtime.js. And for coverage we want to include all of js/*, but for now we know that the other files are at 0% coverage.

alexjsmac commented 8 years ago

Okay all good to go! The files commented out in karma.conf.js are still causing some problems, but the reports shows up now for everything else!

dethe commented 8 years ago

Awesome! Thanks for doing this. :shipit:

CelticMinstrel commented 8 years ago

Nice final commit message.

alexjsmac commented 8 years ago

Aha it was quite a surprise