I have a karma test runner that dynamically writes rail's javascript files to a karma.conf.js file.
Now, everything works (the tests run) if I remove actioncable's javascript files manually from the files list. However, when actioncable's files are added, the preprocessor chokes.
24 08 2016 16:56:22.095:ERROR [preprocessor.coffee]: unexpected < at /home/vagrant/.rvm/gems/ruby-2.2.2/bundler/gems/actioncable-6be2604aa719/lib/assets/javascripts/cable.coffee.erb:4 24 08 2016 16:56:22.296:INFO [karma]: Karma v0.13.14 server started at http://localhost:9876/ 24 08 2016 16:56:22.309:INFO [launcher]: Starting browser PhantomJS 24 08 2016 16:56:23.106:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket RyL0QOEWkq8inzwAAAAA with id 22283032 PhantomJS 1.9.8 (Linux 0.0.0) ERROR You need to include some adapter that implements karma.start method!
Oke doke. So looking at the actioncable erb file:
#= require_self
#= require cable/consumer
@Cable =
INTERNAL: <%= ActionCable::INTERNAL.to_json %>
createConsumer: (url) ->
new Cable.Consumer url
So the preprocessor is definitely choking on the erb tags in this specific file. I have erb tags in other files, that get processed fine, but those are wrapped in quotes. Is this a preprocessor bug, or is there a quick fix for this that I'm not thinking of?