jejacks0n / teaspoon

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

Tests are not running on Rails 5 #501

Closed ephracis closed 7 years ago

ephracis commented 8 years ago

My tests are not being loaded properly in Teaspoon. Tried both jasmine and mocha.

I have verified that the test files are found by Dir.glob in the current directory. The teaspoon_env.rb file is untouched, generated with bin/rails generate teaspoon:install --coffee.

Here's my test file at spec/javascripts/foo_spec.rb:

#= require calculator
describe "Calculator", ->

  it "should add two numbers", ->
    expect( new Calculator().add(2,2) ).toBe(4)
$ bundle exec teaspoon       
Starting the Teaspoon server...
Puma starting in single mode...
* Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
* Min threads: 5, max threads: 5
* Environment: test
* Listening on tcp://127.0.0.1:49534
Use Ctrl-C to stop
Teaspoon running default suite at http://127.0.0.1:49534/teaspoon/default

$

Running Rails 5.0.0.1 and Teaspoon 1.1.5.

n0nick commented 7 years ago

Any updates on this? I just ran into the same issue myself.

sockmonk commented 7 years ago

I've found that some specs run, but one spec sometimes gets ignored, depending on its contents. Progressively commenting things out will get the test to run; I haven't figured out yet what exactly it takes to trigger it. When it does ignore the file, when running with the '-f documentation' flag, the output is:

0 examples, 0 failures

Running Rails 4.2.7.1 and Teaspoon 1.1.5.

n0nick commented 7 years ago

FWIW the problem on my end (running Rails 5) was related to a bug in the Puma server: It did not register to the same port that Teaspoon assigned it, and so Teaspoon was stuck. Fixed in latest Puma: https://github.com/puma/puma/issues/1154

sockmonk commented 7 years ago

In my case, it was a subtle bug in the test file itself. What was surprising was that it caused the whole file to be ignored, rather than show an error. That's javascript for ya.

ephracis commented 7 years ago

I believe it was a small typo for me as well. Can't remember what it was, though. Closing this.