Running compiled unit tests?

33 views
Skip to first unread message

Evan Jones

unread,
Oct 22, 2013, 6:41:47 PM10/22/13
to pl...@googlegroups.com
I'm just getting started with using Plovr and the Closure compiler. It seems like the built-in, auto-generated unit test pages are pretty helpful. However, I'd like to have it COMPILE my unit test, since the entire point is that I want the advanced type-checks in my Javascript code. Is there any easy way to do this? I've figured out that I can do the following:

1. Write a plover config that compiles my source.js and source_test.js files together, along with the appropriate options.
2. Write out my own trivial source_test.html file that references the plovr /compile?id=source_test URL

I can probably automate most of this boilerplate by writing a simple script, but I feel like I must be missing a simple option or something somewhere, to get Plovr to do this for me? I can't be the only person who wants compiled unit tests?

Evan

Greg Perkins

unread,
Oct 22, 2013, 10:09:53 PM10/22/13
to pl...@googlegroups.com
You're not the only person! I definitely want that too. In past projects I've ended up with just about your proposed configuration, except using source_test.soy files instead of source_test.html and plovr's soyweb to serve them. No scripting unfortunately. :-(

I think something that automates this boilerplate would be quite useful!

Evan Jones

unread,
Oct 24, 2013, 4:11:47 PM10/24/13
to pl...@googlegroups.com
Actually, now that I've actually tried this for a few days, I've learned that what I really want is probably something like:

1. Run the unit tests on the uncompiled code (so that stack traces and the debugger are actually useful)
2. BUT display the errors from compiling the unit test (to display type errors, which are useful)


I'd love to hear what other people's workflows are like using Plovr/closure compiler and tests.

Evan


On Oct 22, 2013, at 22:09 , Greg Perkins <gper...@gmail.com> wrote:

> You're not the only person! I definitely want that too. In past projects I've ended up with just about your proposed configuration, except using source_test.soy files instead of source_test.html and plovr's soyweb to serve them. No scripting unfortunately. :-(
>
> I think something that automates this boilerplate would be quite useful!
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "plovr" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to plovr+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


--
Work: https://www.mitro.co/ Personal: http://evanjones.ca/

Reply all
Reply to author
Forward
0 new messages