ProtoCov: Code coverage for Javascript projects

55 views
Skip to first unread message

Pat Nakajima

unread,
May 23, 2008, 7:03:59 PM5/23/08
to Prototype: Core
I’ve started working on a small project to generate code coverage
reports for JavaScript projects. It’s called ProtoCov, and while much
work still needs to be done, I think it has some great potential.

So far, it's very method-oriented. It finds the methods defined in
your code, then checks to see if they're invoked in any of your test
files. I realize that this hardly scratches the surface of the
testable facets of any project, but it's a start.

My regular expression chops aren't so hot, so it misses a few things
here and there. Any help in this area would be appreciated. I'm also
looking into Treetop-based parsing.

Anyway, here's the project: http://github.com/nakajima/protocov.

Patches welcome!

John Barnette

unread,
May 26, 2008, 6:43:37 PM5/26/08
to prototy...@googlegroups.com
Hi Pat,

On Fri, May 23, 2008 at 4:03 PM, Pat Nakajima <patna...@gmail.com> wrote:
> I've started working on a small project to generate code coverage
> reports for JavaScript projects. It's called ProtoCov, and while much
> work still needs to be done, I think it has some great potential.

If you're looking for other parser options, you might check out
Johnson (http://github.com/jbarnette/johnson): As well as providing a
SpiderMonkey runtime in Ruby, we also provide a parse tree with
round-trip support. We're not quite ready for a 1.0, but the parser is
pretty usable.

require "johnson"
ast = Johnson.parse("...")

# ...

ast.to_js


~ j.

Pat Nakajima

unread,
May 27, 2008, 9:04:29 AM5/27/08
to Prototype: Core
Hey, I wasn't able get Johnson up and running on my Mac. Any words of
advice?

On May 26, 6:43 pm, "John Barnette" <jbarne...@gmail.com> wrote:
> Hi Pat,
>

John Barnette

unread,
May 27, 2008, 12:27:47 PM5/27/08
to prototy...@googlegroups.com
On Tue, May 27, 2008 at 6:04 AM, Pat Nakajima <patna...@gmail.com> wrote:
> Hey, I wasn't able get Johnson up and running on my Mac. Any words of
> advice?

We mostly develop it on OS X, so it shouldn't be too much of a
problem. Drop by #johnson on Freenode or contact me via email or GTalk
(jbarnette at the google) and I'm sure we can beat it into submission.


~ j.

Reply all
Reply to author
Forward
0 new messages