Questions tagged [konacha]

Konacha ([koh-NAH-cha], a type of green tea) is a Rails engine that allows you to test your JavaScript with the Mocha test framework and chai assertion library. It is similar to Jasmine and Evergreen, but does not attempt to be framework agnostic. By sticking with Rails, Konacha can take full advantage of features such as the asset pipeline and engines.

Konacha ([koh-NAH-cha], a type of green tea) is a Rails engine that allows you to test your JavaScript with the Mocha test framework and chai assertion library.

It is similar to Jasmine and Evergreen, but does not attempt to be framework agnostic. By sticking with Rails, Konacha can take full advantage of features such as the asset pipeline and engines.

Read more and/or get Konacha at https://github.com/jfirebaugh/konacha

28 questions
1
vote
2 answers

Emberjs integration testing with konacha

Having trouble doing integration testing with Konacha on Ember.js 1.0.rc1. My problem is that all tests run before any views are rendered. Is there a way to know when everything has been rendered without the need to do manual timeouts? spec…
Guu
  • 911
  • 1
  • 9
  • 14
1
vote
1 answer

backbone.js doesn't render view with konacha

I want to do some DOM test for my backbone.js application with konacha. And I have read some entries about konacha…
164c
  • 11
  • 2
0
votes
1 answer

error 'Don't know how to build task 'konacha:serve'

I have followed steps in https://www.botreetechnologies.com/blog/test-rails-app-using-mocha-js-chai-js to setup konacha. I wrote a simple hello world test as follows in spec/javascripts folder: var assert = require('assert'); describe('HelloWorld…
Harinya
  • 181
  • 1
  • 4
  • 18
0
votes
1 answer

Konacha, Mocha, BackboneJS and Ruby on Rails configuration

I am using Konacha to test a BackboneJS application in my Ruby on Rails application. I have read about every tutorial on the web and it shows how easy it is to set up and get working. Unfortunately, I am not having this level of success. Here is…
Mike Riley
  • 282
  • 3
  • 20
0
votes
1 answer

konacha - helper methods coffeescript

I'm trying to define a helper method in konacha in coffeescript, something like this @expect_int_is_universal = (i) -> expect(i).to.equal 42 describe '#test', -> it 'checks if integer is 42', -> @expect_int_is_universal(42) Is it…
apollow
  • 1,250
  • 2
  • 14
  • 22
0
votes
1 answer

Why following test doesn't pass?

I've the following EmberJS/Konacha code. Does anyone have a clue why test doesn't pass ? EDIT: I've added test case which tests the attribute value instead of the reference. #= require ../spec_helper describe "Zaptax.v2014.App.AnswersLookup", -> …
LeszekA
  • 1
  • 1
0
votes
2 answers

Stub .prop() with sinon

Using Konacha and Sinon.js. I have the following Javascript in Coffee Script (simplified for clarity): if $('#payment_cc').prop('checked') console.log 'checked' else console.log 'not checked' I have been trying to stub…
Victor
  • 13,010
  • 18
  • 83
  • 146
0
votes
1 answer

Stub radio button in Konacha Javascript spec

Here is my Javascript: if $("#payment_cc:checked").length > 0 path = "/orders" if @get('tokenize') @_submitWithToken(obj, path) else @_submitWithCC(obj, path) else path = "/orders/paypal" @_submitWithCC(obj, path) I am trying to…
Victor
  • 13,010
  • 18
  • 83
  • 146
0
votes
1 answer

Acceptance Testing Rails using a "Testing API" for client side state control

I am currently evaluating how to test a rather big and complex web application, based on Rails 4 on the server side and EmberJS on the client side. In our app, the client exclusively communicates through a restful JSON API with the server. We did a…
Erik
  • 11,944
  • 18
  • 87
  • 126
0
votes
1 answer

how to test that fullCalendar has been initialized using Konacha

I'm using fullcalendar in a Rails application and want to test the pages that I'm using it on using Konacha. In a file called fullcal_init, I have the following (working) code jQuery(document).ready(function($) { …
dax
  • 10,779
  • 8
  • 51
  • 86
0
votes
1 answer

Ember.js / Konacha / Mocha.js test in promise

I've got some static data that I'm initializing into the ember app like this App.initializer name:"Foo Data" initialize: -> store = DS.get("defaultStore") obj = [ id: 1 name: "whatever" , id: 2 …
user160917
  • 9,211
  • 4
  • 53
  • 63
0
votes
1 answer

Ember can't access the controllers scope in a didLoad callback when testing with Konacha

This code works perfectly on my browser: doLogin: (user) -> _controllers = @get('controllers') res = Cluey.Order.find({table: null, user: user.get('id')}) res.on 'didLoad', => order = @objectAt(0) console.log _controllers …
htatche
  • 693
  • 3
  • 17
0
votes
1 answer

trouble unit testing ember-data model using konacha

The following test will pass if I run each spec independently. If I run them in succession only the first spec will pass. #= require spec_helper #= require models/job #= require ./fixtures/job describe "Job", -> beforeEach (done) -> @job =…
Aaron Renoir
  • 4,283
  • 1
  • 39
  • 61
1
2