jejacks0n / teaspoon

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

Modified to work with Sprockets 4 beta 6 #535

Closed maxhudson closed 3 years ago

maxhudson commented 6 years ago

I was able to get Sprockets 4 beta 6 + es6 javascript files working with teaspoon by making this modification and setting config.expand_assets = false.

Teaspoon is using all of these and throwing errors because of them:

Has a deprecated dependency as far as I can tell (.pathname): http://www.rubydoc.info/github/sstephenson/sprockets/master/Sprockets%2FAsset:logical_path Deprecated: http://www.rubydoc.info/github/sstephenson/sprockets/Sprockets%2FAsset%3Apathname Deprecated: http://www.rubydoc.info/github/sstephenson/sprockets/Sprockets%2FAsset%3Ato_a

The way I modified the suite.rb file probably isn't ideal, but it does work for me. It would probably need to be modified if this were to merge.

jejacks0n commented 6 years ago

I don't think this is a complete solution.. you can have your javascripts in any path, simply by adding paths to the asset paths configuration.

Because of that, I don't see how this is something that could be merged.

So is there any news about what the deprecations are replaced with?

jejacks0n commented 6 years ago

I really appreciate your efforts on this -- this is by no means a slight, I just think asking a maintainer of sprockets might be a better solution -- see if there's an alternative, explain the need for it, etc.

maxhudson commented 6 years ago

I understand. I figured I'd make a pull request in-case you had a real solution.

From what I could tell, .filename is supposed to be used instead of pathname. .logical_path is not actually deprecated, but an error is thrown when it is used saying that .pathname is not a method, so it seems like .logical_path should be deprecated or modified in sprockets. That specific point seems like something worth mentioning to @sstephenson @rails.

As far as .to_a, I'm not sure, but the default configuration of teaspoon seems to rely upon it because the default config.expand_assets is set to true and results in that method being called.

mathieujobin commented 4 years ago

I am guessing this is outdated and could be closed?

mathieujobin commented 3 years ago

looks like this can be closed