jejacks0n / teaspoon

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

Using with Rails 6 #567

Closed rafamanzo closed 3 years ago

rafamanzo commented 5 years ago

I'm starting a fresh application using Rails 6.0.0.rc2 which I'm having trouble to configure Teaspoon to work with it.

Since I have found no specific issue regarding Rails 6 and I believe this will become a recurrent theme, I'm opening this one.

The code I have been working on can be found at https://gitlab.com/interscity/health-dashboard/internasus/tree/1-create-empty-rails-app-teaspoon

So far I have made progress by:

Now I'm stuck on finding out how to require require.js for which I have no clue about its path with Rails 6. No requiring it I believe is the cause for my current error message when running rails teaspoon:

Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:39643/teaspoon/default
ReferenceError: Can't find variable: require
  # application.self-d01bbf06517185239b6ee3ebf2856daf26016b313b2055280be41ff2a6f00aad.js:6 -- global code

Does anyone have had success with Rails 6? Thanks in advance!

mathieujobin commented 5 years ago

I think you need to load both from github

gem 'teaspoon', github: 'jejacks0n/teaspoon' 
gem 'teaspoon-jasmine', github: 'jejacks0n/teaspoon' 
rafamanzo commented 5 years ago

Thanks for the suggestion.

I've tested it in this branch: https://gitlab.com/interscity/health-dashboard/internasus/tree/1-create-empty-rails-app-teaspoon-ii

But I'm still experiencing the same error and then the terminal is stuck:

bundle exec rails teaspoon          
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:37919/teaspoon/default
ReferenceError: Can't find variable: require
  # application.self-d01bbf06517185239b6ee3ebf2856daf26016b313b2055280be41ff2a6f00aad.js:6 -- global code
mileslane commented 5 years ago

Is there a Rails 6.0 compatible release coming soon? I am going to have to find a replacement otherwise.

schneems commented 5 years ago

I came to ask the same question. Looks like the last release https://rubygems.org/gems/teaspoon was from 2016.

heitorsilva commented 4 years ago

@schneems if you look at the releases in the repo, they're also stuck on 2016: https://github.com/jejacks0n/teaspoon/releases

arsduo commented 4 years ago

I'm running into the same problem :( if any of you have recommendations for an alternative, I'd be grateful. Otherwise, if I find anything, I'll post it here.

rafamanzo commented 4 years ago

I gave up on teaspoon and started using jasmine standalone.

It required some work and a lot of digging to get jasmine working. If anyone is interested on how I did it you can check the MR here: https://gitlab.com/interscity/health-dashboard/internasus/-/merge_requests/70. Each commit is supposed to have more details in its description about the changes.

mathieujobin commented 4 years ago

Thank you @rafamanzo

ghiculescu commented 4 years ago

version 1.2 has been released. i assume it includes the rails 6 fixes. https://github.com/jejacks0n/teaspoon/releases

ghiculescu commented 4 years ago

changelog is out of date :( https://github.com/jejacks0n/teaspoon/blob/master/CHANGELOG.md

mathieujobin commented 3 years ago

changelog was updated and 1.2.0 presumably fully support rails 6

release will be pushed to rubygems a little later

please use latest master from github in the mean time

gem 'teaspoon', github: 'jejacks0n/teaspoon' 
gem 'teaspoon-jasmine', github: 'jejacks0n/teaspoon'