All Questions
22
questions
0
votes
1
answer
292
views
stView.el is undefined while testing Backbone view with jasmine
I'm using Jasmine for unit testing to test an application with Backbone.js (and it's the first time that I'm working with them both so I'm a little bit stuck :/ )
Here is my Backbone view
...
0
votes
0
answers
47
views
How to set the dependency of dynamically generated .js library through require in jasmine specs
Currently I am writing jasmine specs for already developed backbone.js application. I have to write jasmine specs for each module for unit testing. I have a module in which one of the .js (say abc.js) ...
1
vote
1
answer
2k
views
Backbone Views / Jasmine / Requirejs - Cannot read property replace of undefined
Using Jasmine, I have already written tests for my models and controllers and all have passed. However, I am running into a lot of problems if I test my views.
IF I remove views/hf_appView from ...
1
vote
0
answers
58
views
Jasmine Grunt, Backbone, Require, Routes etc
i have a question. I have a full app, a lot of view(backbone), models, everything using require, routes etc. When my app is on production i have a single file main.js, like this:
<script data-main=...
0
votes
2
answers
207
views
JS: replace function definition before object instantiation
I have outerView and innerView inside my require.js module. They can be described with few statements:
InnerViews is instantiated on OuterView rendering
InnerView calls calculated method on own ...
0
votes
1
answer
40
views
Testing with Require js in Jasmine
I recently joined on a project and I am very new to practically everything we're using. Currently I'm trying to set up some unit tests in Jasmine for out javascript code. I've been learning Jasmine ...
2
votes
1
answer
263
views
Backbone integration tests: Zombie.js and RequireJS, how to?
I'm trying to test my Backbone.js web application.
Since this application is basically only consuming web services, there is not really business logic inside, and the app is simply addressing calls to ...
0
votes
1
answer
105
views
How to stub require.js module in Backbone initialize method
Hello I want to be able to stub requirejs modules that get called in the initialize of a Backbone object. For example:
define(function(require){
var Backbone = require("backbone"),
...
3
votes
1
answer
3k
views
How to configure karma to use 'define' (with backbone.js) properly?
I've installed karma. I've created a karma.conf.js file and pointed to my source files. In my source files is included a version of require.js.
Everything seems fine (it launches the node server, ...
0
votes
1
answer
949
views
Spying on event callbacks with Jasmine
I am using Jasmine to test a Backbone.js view within a Require.js module.
Why does my test fail if I don't wrap the callback in an anonymous function?
Here's the test:
describe("view extension", ...
1
vote
1
answer
679
views
Jasmine not starting in my browser (with Backbone and RequireJS) - have to keep refreshing
I've got just over 400 tests in my Jasmine test suite now but I seem to have a small problem. The specrunner only seems to actually run one in 5 times and it's success seems quite random. When it '...
4
votes
1
answer
2k
views
How to stub Backbone View instantiated within another Views render method when Using RequireJS (and Jasmine / Sinon)
I am attempting to write unit tests using Jasmine and Sion but I am struggling to find the equivalent of the following when using RequireJs to load modules:
sinon.stub(window, "MyItemView");
When ...
0
votes
1
answer
203
views
How to use jasmine-require with Backbone?
I would like to use my require.js for Backbone within a Jasmine test suite; and I am working on the setup.
I've seen the use of https://github.com/scottburch/jasmine-require in this test setup: https:...
1
vote
2
answers
2k
views
How to setup Jasmine with RequireJS?
I am having a problem to figure out how to setup Jasmine with modules from RequireJS.
Basically, I want to test a first view:
it("can load sandbox", function() {
var view = new ItemView();
node =...
2
votes
1
answer
2k
views
How to write the following test in Jasmine
My test claims to interpolate data into strings, but actually also checks if the model automatically updates the DOM. How should I handle this situation?
Test for ItemView using Jasmine:
describe("...