jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Framework fallbacks for updated versions? #275

Closed phyllisstein closed 9 years ago

phyllisstein commented 9 years ago

Hey there! Sorry to be a bother, but I wanted to ask a quick question about Teaspoon's innards---in particular, the way it chooses test frameworks. I noticed that the Mocha dependency is getting a little long in the tooth---it's been ten months or so since 1.17.1, and they're on a 2.0 now---and was hoping to just drop in an updated version, either through Rails Assets/Bower, which would insert it into the asset pipeline, or npm, which, naturally, wouldn't. But my quick glance at Teaspoon's code made it seem as though it's pretty careful and strict about loading only bundled assets. So I was curious whether it'd require a massive overhaul for it to check---or fall back on---node_modules and preinstalled assets for Mocha et al. I haven't given the code-base more than a cursory skim myself, so I might eventually see my way clear to monkey-patching it or something, but I figured it couldn't hurt to ask, too.

Thanks so much for all your work on this really stellar test-runner, which has been saving me from certain Karma for months now.

phyllisstein commented 9 years ago

Whoops, turned out to be way easier than I'd imagined. Apologies for the superfluous issue!

In case anyone else is trying to figure out the same thing, I just commented out suite.use_framework :mocha, and changed my suite.javascripts to point directly to Rails Assets' version, which is in the Asset Pipeline as mocha/mocha. I also had to add ;_mocha_version = '2.0.1' to the top of mocha.js, but that's no big deal. So I was left with what's in this gist, and it seems to work just beautifully.

jejacks0n commented 9 years ago

Thanks! that's good to know from my end as well. If you want to submit a PR with added version it'd get merged. Specifically documenting it in the install generator templates, and readme.

I've been slammed on other things, but it's always appreciated when someone is doing checks for version updates.

phyllisstein commented 9 years ago

Totally understandable, with the slamming. I'd be happy to fold in the latest version for pulling! It might take me a day or two to find the time and get it all together, but compared to the changes I was imagining making it'll be a breeze.