Questions tagged [teaspoon]

A JavaScript test runner for Rails. Can run tests both in the browser as well as headless.

Teaspoon is a JavaScript test runner that can run the tests either in the browser or headless tests using PhantomJS or Selenium WebDriver. It ships with support for Jasmine, Mocha, QUnit and AngularJS. The project is being run on github.

46 questions
2
votes
2 answers

Teaspoon showing some weird error on CircleCI

I am using teaspoon for some javascript testing (written in CoffeeScript) on my development machine everything works great: → bundle exec rake teaspoon Starting the Teaspoon server... Teaspoon running default suite at…
edariedl
  • 3,234
  • 16
  • 19
2
votes
0 answers

Using Syn library to simulate drag and drop on Qunit/PhantomJS

I keep getting this same error -> Argument 1 of Document.elementFromPoint is not a finite floating-point value. I am trying to drag the 'group' element to the addGroupBtn. However I can't seem to get any simulation to work, I even ran in teaspoon…
arinh
  • 206
  • 1
  • 12
2
votes
1 answer

Guard spec/javascripts tests only run tests the first time

I am trying to get guard to work with Jasmine tests. I have tried guard-jasmine with jasminerice, guard-jasmine with jasmine-rails, and teaspoon. I end up getting the same error - the tests work the first time I set up guard, but every time I save a…
shicholas
  • 6,123
  • 3
  • 27
  • 38
1
vote
0 answers

Selenium::WebDriver::Error::SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 74

This is not a duplicate because both provided related questions do not address why web drivers gem is not working to automatically update chrome, which is it's intended purpose. The solution proposed show to fix manually, I am looking for a…
user2012677
  • 5,465
  • 6
  • 51
  • 113
1
vote
0 answers

Testing Teaspoon: Expected true to equal false

modal.hide() is not closing the modal in tests, but works in manual testing. When I check if I can see the modal variable, I can see it from the 'it' statement, so I am not sure why I get a true when it should be…
user2012677
  • 5,465
  • 6
  • 51
  • 113
1
vote
1 answer

Calling a Javascript class method gets error 'Can't find variable'

When I run my teaspoon-jasmine test, I get the following error. Error ReferenceError: Can't find variable: modify_create_favorite in http://localhost:3000/assets/favorite.self-67fd17843e64bfbeed401bd.js?body=1?body=1 (line 49) favorite.js…
user2012677
  • 5,465
  • 6
  • 51
  • 113
1
vote
0 answers

How to test a function which reload a location with Teaspoon-mocha and Sinon

I'm a beginner in testing and I would like to understand how could I test a function which as a purpose has to reload a page every 10s. I would like to understand what I need to mock with an example. The function: $(document).ready(check); …
Jakub
  • 2,367
  • 6
  • 31
  • 82
1
vote
1 answer

How to call $(document).ready(function() {…}); from another file JS

I would like to know how to call the function below without refactoring from another js file. $(document).ready(function() { check(); function check () { setTimeout(function(){ location.reload(true); }, 10000); } }); I saw a…
Jakub
  • 2,367
  • 6
  • 31
  • 82
1
vote
1 answer

How to use Teaspoon for JS testing

I'm new to JS testing and I would like to understand how to test a JS function I have. I'm using Teaspoon-mocha as the testing library and the function I would like to test is: var C_FORM = "http://www.exmple.com/SomeForm#Form"; function…
Jakub
  • 2,367
  • 6
  • 31
  • 82
1
vote
1 answer

Jenkins not running istanbul JS code coverage tool

I am using Teaspoon + Istanbul JS code coverage tool for Ruby project,which has more JS code in it. I have installed istanbul using $ npm install -g istanbul commend on the jenkins box. If the run bundle exec teaspoon, it works fine on local and…
Sruthi
  • 69
  • 1
  • 4
1
vote
0 answers

Emberjs tests hang when running through CLI

My Ember test suite is timing out when I run it through the command line. I've tracked this down and it's due to ajaxComplete not firing for an AJAX request that is kicked off through a call to visit, but this same request fires the complete event…
Gowiem
  • 1,297
  • 17
  • 19
0
votes
1 answer

Reload window on every jasmine spec in teaspoon

Using teaspoon and jasmine to test some JS. The js is putting things in 'window'. Is there a way to completely reload the page for every spec so that this 'window' is newly initialized.
kmitov
  • 1,243
  • 3
  • 11
  • 25
0
votes
0 answers

Why is Number not a constructor in my Teaspoon/Jasmine spec test?

I am attempting to test a .js.coffee file and I continually get error: Failure/Error: TypeError: undefined is not a constructor (evaluating 'Number.isNaN(likesCount)') I believe I need to include Number in my spec file, how do I do this? I am new…
sroman
  • 11
  • 2
0
votes
1 answer

Expected spy click to have been called

I am testing that the click event for an element is called in Jasmine-Teaspoon. However, I am getting an error: "Expected spy click to have been called." describe("onPlayerStateChange", function(){ it("should stop video when data equals to…
user2012677
  • 5,465
  • 6
  • 51
  • 113
0
votes
1 answer

how to write a jasmine spec for triggering a on event in jquery

how to write a jasmine spec for triggering a on event in jquery ? $('#myid').on('keyup', function (event) { if(event.which === 13) { event.preventDefault(); myfunc(id); } }); those lines are…