jasmine/gem pull request 37: Add Coverage Support with jscoverage

215 views
Skip to first unread message

David J. Hamilton

unread,
Jun 1, 2011, 5:47:54 PM6/1/11
to Jasmine Dev
Is there any interest in the jasmine dev team for adding coverage
support to jasmine-gem, via jscoverage? I wasn't able to find any
accepted practice for getting automated coverage of jasmine tests, so
I wrote a small pull request[1] to this end.

Does anybody have any comments, questions or concerns about the
general approach or any of the specifics?

Is this pull request likely to be accepted?

[1] https://github.com/pivotal/jasmine-gem/pull/37

-djh

Rajan Agaskar

unread,
Jun 3, 2011, 7:45:22 AM6/3/11
to jasmine...@googlegroups.com
This seems like a reasonable feature for Jasmine to offer -- we're pretty slow at merging pull requests so I can't promise a timeframe, but the tests look good and I like that you caught and fixed a couple of other minor things.

Thanks!

Rajan 


--
You received this message because you are subscribed to the Google Groups "Jasmine Dev" group.
To post to this group, send email to jasmine...@googlegroups.com.
To unsubscribe from this group, send email to jasmine-js-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jasmine-js-dev?hl=en.


David J. Hamilton

unread,
Jun 3, 2011, 11:54:29 AM6/3/11
to jasmine-js-dev
Excerpts from Rajan Agaskar's message of Fri Jun 03 04:45:22 -0700 2011:

> This seems like a reasonable feature for Jasmine to offer -- we're pretty
> slow at merging pull requests so I can't promise a timeframe, but the tests
> look good and I like that you caught and fixed a couple of other minor
> things.

Sounds good Rajan. Thanks!
--
med vänlig hälsning
David J. Hamilton

Davis Frank

unread,
Jun 6, 2011, 12:26:45 AM6/6/11
to jasmine...@googlegroups.com
Does this really belong in Jasmine? I feel like this makes for an excellent How-To, but that core doesn't need to maintain it.

--dwf


--

Rajan Agaskar

unread,
Jun 7, 2011, 8:16:50 AM6/7/11
to jasmine...@googlegroups.com
That's fair. I'm under the impression (perhaps mistaken?) that many test frameworks support coverage reporting. True, there's a lot of additional LoC here, but it's confined entirely to the jasmine gem. 

Whether or not it makes it into core (and it's true that many of our users probably don't use code coverage tools, so I'd be OK if we decide it doesn't make sense for core), this is a probably a good example of what the plugin architecture should support.

Rajan

David J. Hamilton

unread,
Jun 10, 2011, 1:10:04 PM6/10/11
to jasmine-js-dev
> On Mon, Jun 6, 2011 at 12:26 AM, Davis Frank <dwf...@pivotallabs.com>wrote:
>
> > Does this really belong in Jasmine? I feel like this makes for an excellent
> > How-To, but that core doesn't need to maintain it.

I think coverage support for tests is a common enough use case that it should be
__easy__ to add.

That said, I think it's also perfectly reasonable for core to be more focused,
in which case the pull request can be interpreted as an issue: “It's too hard to
add coverage support for jasmine tests”.

Excerpts from Rajan Agaskar's message of Tue Jun 07 05:16:50 -0700 2011:


> Whether or not it makes it into core (and it's true that many of our users
> probably don't use code coverage tools, so I'd be OK if we decide it doesn't
> make sense for core), this is a probably a good example of what the plugin
> architecture should support.

I agree. The main reason I didn't write this as a gem was because of the
headache of monkeypatch maintenance. From what I can recall, the two areas
where I would need hooks to make this a standalone gem are:

1. Support for multiple config (jasmine.yml) files, preferably driven by an
environment variable.
2. A hook to run arbitrary ruby code at the end of a test run, but before the
runner has stopped. The hook needs an API for running arbitrary
javascript in the runner.

Davis Frank

unread,
Jun 10, 2011, 7:58:20 PM6/10/11
to jasmine...@googlegroups.com
We are painfully aware of how hard it is to customize the config.  There are some stories in the backlog and a couple of discussions of how we want to tackle it in the list archive.

Our goal is clear: it should be brainless to config the gem to say "MY FILES ARE HERE" and "DO THIS TO RUN THEM".

The former should allow files to live wherever a project wants them. The latter should allow a project to construct whatever it wants around the action of telling a JS interpreter to eval the needed JS files and then telling Jasmine to run.

--dwf

s9tpepper

unread,
Sep 14, 2012, 2:26:02 PM9/14/12
to jasmine...@googlegroups.com, dwf...@pivotallabs.com
I just started looking for a solution to provide test coverage reports on my Jasmine tests, was there ever a final resolution to this item? I'm Googlin' away trying to find the most recent info I can find on what Jasmine users are now using for test coverage.

Sorry if this question is on the wrong list, but I found this info here. :)

-omar

Rajan Agaskar

unread,
Sep 14, 2012, 5:39:52 PM9/14/12
to jasmine...@googlegroups.com, dwf...@pivotallabs.com
I think where we left it was this: we're working towards making it easier to add things like jscoverage support to jasmine for people who want it, but we don't think jscoverage specifically should be a responsibility of the jasmine gem. 

Thanks!

Rajan

To view this discussion on the web visit https://groups.google.com/d/msg/jasmine-js-dev/-/aVPiECN3OD4J.
Reply all
Reply to author
Forward
0 new messages