Comments (12)
Teabag doesn't do any of the coffeescript conversion for you and relies on the asset pipeline that Rails provides.. can confirm that you have coffeescript setup in Rails -- eg. "gem 'coffee-rails'" in your Gemfile?
And that you can load a converted coffeescript file as js in the browser? Try loading one of your coffeescript files in by the url (/assets/your_file.js) and see if it serves it.
from teaspoon.
Thanks for the quick reply!!
Coffeescript is working just fine in the rest of rails (i.e. for coffeescript files in the standard directories).
Do I have to somehow tell rails to compile coffee files in the test/javascripts
directory?
from teaspoon.
no, you shouldn't.. is it serving files from that path at all?
from teaspoon.
It should be adding /test/javascripts to your asset paths:
https://github.com/modeset/teabag/blob/master/lib/teabag/configuration.rb#L10
which is then added to the asset paths in the engine:
https://github.com/modeset/teabag/blob/master/lib/teabag/engine.rb#L11
Can you confirm this is happening?
from teaspoon.
Nope...
localhost:3000/assets/application.js
--> works
localhost:3000/assets/test/javascripts/my_test.js
--> does not work (there is a test/javascripts/my_test.coffee
file)
Something that may lead in the right direction.... The teabag support files are in coffeescript, and seem to be working just fine. It's just the tests that aren't being compiled.... Not sure if that helps?
from teaspoon.
Try /assets/my_test.js
from teaspoon.
Ugh. I'm so sorry. I had a syntax error in my coffeescript, and it was throwing an error....
from teaspoon.
No worries, thanks for the follow up.
from teaspoon.
@jejacks0n I actually have the same kind of issue with .coffee files under spec/javascripts (using Mocha, with expect and chai). Unlike coffee files under app/assets/javascripts, they are not compiled at runtime and, in particular, the #= require
directives are not expanded so specs just fail.
If I understood it well by reading the source code, the asset pipeline should be aware of spec/javascripts as a location for compiling, so no explicit setting is required. Do you have an idea about what could be going wrong here?
Thank you!
edit: I saw that it actually generates .js files, but for some reasons, the dependencies are not loaded. When I delete the .js file and run the spec again, it passes. This ends up generating the .js file again, and then the spec fails. This looks like an issue unrelated to teaspoon, but rather involving the asset pipeline (but you may have a hint about it!).
from teaspoon.
It turned out that I had a syntax error in my coffeescript. Should work
after that!
On Thu, Jun 20, 2013 at 6:21 PM, Jean-Denis Vauguet <
[email protected]> wrote:
@jejacks0n https://github.com/jejacks0n I actually have the same kind
of issue with .coffee files under spec/javascripts. Unlike coffee files
under app/assets/javascripts, they are not compiled at runtime and, in
particular, the #= require directives are not expanded so specs just fail.If I understood it well by reading the source code, the asset pipeline
should be aware of spec/javascripts as a location for compiling, so no
explicit setting is required. Do you have an idea about what could be going
wrong here?Thank you!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/75#issuecomment-19792134
.
from teaspoon.
Well, the thing is, it works smoothly when running the website. The broken behavior is specific to running the spec. If I find something, I'll share the insight with you here :)
from teaspoon.
I fixed the issue. It was unrelated to teaspoon, as eventually expected: a setting in my .vimrc was triggering auto-compilation of .coffee edited files. Thank you for your help!
from teaspoon.
Related Issues (20)
- Add Support for Istanbul-nyc HOT 2
- javascript_include_tag needs to support new nonce: true option HOT 9
- New release HOT 3
- teaspoon 1.2.0 causes Teaspoon::EnvironmentNotFound error HOT 13
- Selenium Timeout with Rails 6 HOT 10
- Coverage output path ignored in 1.2.0 HOT 3
- Reload window on every jasmine spec in teaspoon HOT 1
- Browser console output should be logged to log/development.log HOT 2
- TypeError: undefined is not an object (evaluating 'window.SpreePaths.mounted_at') HOT 3
- [ANN] Looking for a new maintainer HOT 2
- Ruby 3.0.0 HOT 2
- Migrate from Travis to use Github Actions HOT 1
- Support newer version of Jasmine
- How to use headless chrome with Teaspoon
- Coverage when specs are in test/dummy HOT 1
- Is teaspoon-mocha actively managed? HOT 3
- Sprockets 4 support
- Not getting coverage reports after upgrading from rails 5 to rails 6 HOT 3
- Code coverage not working with Puma 6.2 HOT 5
- Teaspoon fails to load webrick on Rails 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teaspoon.