All Questions
150
questions
2
votes
1
answer
2k
views
Struggling to setup Jasmine with RequireJS. Module's relative paths in define break when calling from test framework.
I have a project with which I have just recently introduced RequireJS. Before RequireJS, I had been testing my project with Jasmine. I am now trying to update Jasmine's SpecRunner so that it can ...
8
votes
1
answer
2k
views
JavaScript dependency injection using RequireJS, Jasmine and testr
I've just looking for dependency injection in my unit test strategy using RequireJS and Jasmine. I really like the idea behind testr and I have tried to setup testr following the examples in github ...
2
votes
1
answer
91
views
How to spy a module which is loaded asynchronously
I am in the following situation.
The code (3) works with the code (1) but not with the code (2).
IMH, the reason is because the backendController module in case (2) is loaded asynchronously after the ...
1
vote
0
answers
346
views
Backbone, Require, Jasmine view not rendering
For the life of me I can't seem to get my view to render HTML within a Jasmine test. I have been following all the tutorials I can find but nothing is working.
require(['../js/app', '../js/views/...
2
votes
2
answers
1k
views
json RequireJS plugins + jasmine
I'am using jasmine for testing JavaScript code.
The javascript code is made of module which are loaded using requireJs.
When I load json file using json requirejs-plugins which requires text! plugin ...
0
votes
1
answer
1k
views
Jasmine require.js maven plugin
I am trying to configure jasmine maven plugin to load jasmine specifications using require.js.
Below is my maven configuration
<plugin>
<groupId>com.github.searls</groupId>
<...
3
votes
2
answers
3k
views
How to configure RequireJS (require.config()) with jasmine-node?
I have an init file that provides a function that bootstraps RequireJS via require.config(). The configuration ends up looking something (mostly) like this:
...
config =
baseUrl: sysDir + 'lib/'
...
1
vote
1
answer
490
views
Jasmine test with Require/Backbone project
My objective is to test the TDD (Test driven development). But after one weekend on it , I really need your help :)
First Question : "What is the best way to TDD between Browser runner
or ...
2
votes
1
answer
2k
views
Check Backbone/requireJs project with Jasmine
I have a project loaded using RequireJS and I would like to test the models.
I have the following test :
require(['../../js/models/lead_sharing'], function(Lead_sharing_Model) {
describe('when ...
1
vote
1
answer
1k
views
How to test a script which loads a google maps with Jasmine
I'm having difficulties in writing tests for a page which loads a google maps. I'm always getting the error
" Cannot read property 'offsetWidth' of undefined "
which means that when the map ...
3
votes
1
answer
6k
views
Jasmine and requireJs - Mismatched anonymous define() module:
I am trying to use Jasmine.js test with requires.
Here's part of my specRunner
<script type="text/javascript" src="<?php echo $rootRequirejs?>/require.js"></script>
<script type=...
4
votes
1
answer
911
views
How should I write the spec file using requireJs?
I have a model which looks like this:
//myModel.js
define([], function () {
var MyModel = Backbone.Model.extend({
// my code
});
return MyModel
});
Then If I want to write a spec ...
7
votes
4
answers
5k
views
Jasmine + JSTestDriver + Coverage + RequireJS
Wow, what a mess. This is the scenario.
Backbone driven JS app.
RequireJS for AMD functionality, initialized like this:
<script data-main="js/main" src="js/require.js" type="text/javascript">&...
3
votes
1
answer
2k
views
Using require.js with jasmine to load scripts returning 404
I'm using Backbonejs and am using require.js to load each dependent backbone widget before firing up my app and putting everything in a custom namespace, in this case "Foo". I'd like to have Jasmine ...
4
votes
3
answers
5k
views
jasmine-maven-plugin and require-js result in path issues
I am using require-js to model dependencies in my java script project. I also use jasmine to write BDD styled test cases and the jasmine-maven-plugin:1.1.0 to execute these tests in headless mode.
...