[TIP] [nose-users] Re: ANN: Nose Plugin to run JavaScript tests

Kumar McMillan kumar.mcmillan at gmail.com
Mon Feb 16 16:10:02 PST 2009

On Mon, Feb 16, 2009 at 3:13 PM, John J Lee <jjl at pobox.com> wrote:
> I see the page mentions python-spidermonkey.  The information about that
> is already out of date, since Paul J Davis has been working on it, and he
> has the code in a repository on github.  The PyPI page is the best place
> to locate up-to-date project information:
> http://pypi.python.org/pypi/python-spidermonkey/0.0.3


> Certainly it should be possible to call functions in JS.

Hmm, actually, I think it was just my misunderstanding of the original
docs when it said you can't call a method *in Python* that was defined
in JavaScript.  But calling a method in JS defined in JS probably
always worked.

Well, I was able to revive a local build I had of python-spidermonkey
from Atul's google code repository.  I then hacked up a version of the
plugin that accepted --spidermonkey to switch the engine over.  A fork
is available here:

I couldn't get it fully working.  Unfortunately, the exception
"spidermonkey.JSError: can't evaluate JavaScript script" is not very
helpful and I hit a brick wall where I wasn't sure what exact error
was happening in JavaScript land.

John, do you know if Paul's latest implementation has seen any work on
exception messages?  After I saw your message I tried to build Paul's
version but had no luck.  There were no instructions and I had a lot
of trouble getting the XUL dy-libs to bind correctly.  I forget
exactly how I first got it to build in Atul's fork.

When I figure out how to build the new python-spidermonkey I'll pick
up where I left off on the fork.  This is great news!


> John
> On Sun, 15 Feb 2009, Kumar McMillan wrote:
>> I've been messing around with a Nose plugin that discovers JavaScript
>> test files (just like .py files but ending in .js).  It collects them
>> and runs them all at the end in a java subprocess using Rhino.  Not
>> the most elegant solution but so far it seems like a nice way to
>> maintain a test suite of both Python and JavaScript code.
>> easy_install NoseJS
>> Documentation: http://pypi.python.org/pypi/NoseJS
>> It's still experimental so if anyone has a suite of JavaScript tests
>> please let me know if it works or not.  There is some support for
>> JavaScript libraries that are tied to the DOM of a browser.
>> -Kumar
>> PS. Even though the root of the word "Rhinocerous" means nose in
>> ancient Greek I still couldn't think of a clever name that wasn't,
>> well, too clever.
>> >
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "nose-users" group.
> To post to this group, send email to nose-users at googlegroups.com
> To unsubscribe from this group, send email to nose-users+unsubscribe at googlegroups.com
> For more options, visit this group at http://groups.google.com/group/nose-users?hl=en
> -~----------~----~----~----~------~----~------~--~---

More information about the testing-in-python mailing list