newjs rake task

6 views
Skip to first unread message

Jim Griswold

unread,
Jan 28, 2009, 1:53:44 PM1/28/09
to JavaScript Project Generator
Dr Nic, I am really excited at the prospect of a javascript unit
testing framework which hooks easily into autotest, thank you for all
your great work on this. The fact that it works so well right out of
the box is quite impressive.

I have recently incorporated newjs 1.5.1 into a rails project I'm
working on, and I am surprised to see how the library integrates with
rake. In runner.rake (line 5), there is a call to
JavaScriptTestTask.new(:javascripts, 4711), which it seems you are
using to define the :javascripts rake task. This code executes
whenever rake is run, even those outside of the test namespace. The
issue is that within JavaScriptTestTask#initialize, you instantiate a
new webrick server. This seems quite obtrusive, and I can't imagine
that this is something you intended to have happen whenever any rake
task is run.

I do not understand the entirety of the source well enough to
confidently submit a patch, but my kneejerk reaction to this is that
this code could be moved to the task definition itself, which would
presumably defer execution until webrick is actually needed.

It is entirely possible that I simply did not set up the library
correctly within my project, but I don't think this is the case, since
I installed the gem according to the posted instructions.

Thank you once again for the great work on this project, and I look
forward to seeing it develop.

Jim Griswold

Jim Griswold

unread,
Jan 28, 2009, 2:20:00 PM1/28/09
to JavaScript Project Generator
Here is my modified runner.rake that I'm using to work around this
issue.

http://gist.github.com/54136

I haven't noticed any problems with it, but please let me know if this
breaks any functionality.

Jim
Reply all
Reply to author
Forward
0 new messages