Code Coverage?

I am trying to setup test coverage for my work's application. At the moment we use zombie to start the application and mocha to test models and kinds. Looking at tools such as node-jscoverage and similar, we cannot seem to get the application running from the conversion. Is there a specific code coverage tool used by enyo application that I should be looking at? This is my first attempt at code coverage testing and I feel like I am doing something wrong.
Thanks for any help.


  • How are you trying to start the application from your tests? We're not currently using a code coverage tool internally for Enyo, so I don't have much experience to help you here.
  • We load our application using zombie (headless browser) then we can perform our tests in mocha. I posted a similar question to the mocha (Google) group and on Stackoverflow because I wasn't sure if this is something other teams have done anything like this successfully.
  • Ah, we've been using PhantomJS to do headless testing, but using the Enyo test suite, not a separate test runner framework.
  • edited July 2013
    I have been trying to get enyo to work in a zombie browser session as well. I visit the local index.html page for my application with the zombie browser. It keeps saying that my object kind "Leirituli", which is an enyo object, is not defined. Hence, it cannot instantiate it. This is within node/cucumberjs. I tried including a file test.js in the pages head. The test.js file just defined a variable. I could access that variable using zombie's browser.eval('console.log ...

    If you're so inclined you may take a look:
  • Are you trying to load a debug version of your app or a minified release version? I'd suspect that zombie doesn't handle the document.write() calls to load files from package.js correctly with that kind of error.
  • I started this project back before enyo 2.1. I am running 2.0.5b. So, this is pre-bootplate stuff. I could try updating. Maybe that would fix things.
  • I updated to use the latest bootplate release. At the least, now I have a different error message. It says
    Object # has no method 'depends' TypeError: Object # has no method 'depends'
        at :1:6
        at (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/node_modules/contextify/lib/contextify.js:12:24)
        at Object.window._evaluate (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/lib/zombie/window.js:189:25)
        at Object.HTML.languageProcessors.javascript (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/lib/zombie/scripts.js:24:21)
        at Object.define.proto._eval (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:1458:47)
        at Object.loaded (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/lib/zombie/scripts.js:77:23)
        at /home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:73:20
        at Object.item.check (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:339:11)
        at Object.item.check (/home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:342:23)
        at /home/moriger/RubymineProjects/bootplate/node_modules/zombie/node_modules/jsdom/lib/jsdom/level2/html.js:357:12
    So, I suppose that is progress. There must be some workaround for the dependencies.
  • was that with a minified version or still the debug one?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!