jejacks0n / teaspoon

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

Sprockets-ES6 compatibility? #338

Closed phyllisstein closed 9 years ago

phyllisstein commented 9 years ago

Hey there! Sorry to be a bother again---what with Angular in the past and ES6 now, I feel like the queen of the edge cases---but I've been having some trouble persuading Teaspoon to work with sprockets-es6. I added the es6 and js.es6 extensions to the suite.matcher setting, then tried running Teaspoon with a dummy spec file:

describe('the thing', function() {
  it('does the thing', function() {
    (1 + 1).should.equal(2);
  });
});

But Teaspoon kept looking for the asset at /javascripts/dummies/dummySpec.es6.js, whereas it should have been looking in /assets/dummies/dummySpec.js. So I forked the repo and tweaked normalize_js_extension to include the ES6 extensions. Teaspoon was then able to find and ask for the asset, but Sprockets complained that dummies/dummySpec.js wouldn't be compiled in production. Do you have any idea what steps I might be missing to get .es6 files included in the precompilation list?

Thanks in advance for your thoughts!

phyllisstein commented 9 years ago

100% sprockets-rails' fault. Color me surprised.