[LRUG] Testing JS in Rails 4

James Coglan jcoglan at gmail.com
Tue Jul 30 12:14:38 PDT 2013


I have a conundrum. Whereas:

* JS testing is easiest if done with a bunch of static HTML/JS files rather
than booting a web framework and various weird opaque and brittle glue
libraries, especially if you want to use a runner/CI system like TestSwarm,
Testling, Karma, Testem or Buster

* Testing your production files is better than testing your source code

* The Rails 3 asset pipeline produced files both with and without digest
hashes in the filename, and you could use the predictable digest-less names
for test setup (even though compiling assets in development mode produces
other weird bugs because of Heroku using ActionDispatch::Static in
production)

* The Rails 4 asset pipeline no longer produces digest-less files

Therefore:

How do you test your JS? My opinion so far is to just write source JS that
doesn't require a build step, or use a build system that's not coupled to
Rails.

Your thoughts?

-- 
James Coglan
http://jcoglan.com
+44 (0) 7771512510
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130730/659e2a51/attachment-0003.html>


More information about the Chat mailing list