All Questions
150
questions
0
votes
2
answers
34
views
What does calling 'done' do in the context of asynchronous testing?
In Louis' answer, there is the following code:
describe("ModuleName", function() {
var mod;
beforeAll(function (done) {
// This loads your module and saves it in `mod`.
...
5
votes
1
answer
1k
views
Karma/Jasmine tests fail with error: 'Uncaught Error: Module name "simple_test.js" has not been loaded yet for context: _. Use require([])'
I am using Karma and Jasmine to run tests on my project built with React. When I try to run my Karma tests I get this error in the console:
Running "karma:test" (karma) task
WARN `start` method is ...
0
votes
1
answer
38
views
Where is this object now?
I have to test some RequireJS JavaScript code and don't understand how to replace a special object. This is the code (simplified) of one function within a RequireJS Module:
changeView: function (view)...
8
votes
2
answers
468
views
require using AMD pattern gives error for jQuery UI events
In my code test.js is dependent on jquery-ui which does not uses require AMD pattern and test.spec.js dependent on jquery-ui, test.js which uses AMD pattern. Can we load dependency of jquery-ui in ...
8
votes
2
answers
6k
views
"Error: Mismatched anonymous define()" with Karma + RequireJS + Jasmine
I am stuck now for a while trying to get unit testing set up and runnning.
I have an AngularJS front-end loaded with RequireJS and r.js optimized for production, so it's all nicely in one single file....
0
votes
1
answer
216
views
Can't figure out where to put require.config when using TypeScript, RequireJs, and Jasmine
I've been following the pattern for setting up TypeScript, RequireJS, and Jasmine that Steve Fenton describes here:
https://www.stevefenton.co.uk/Content/Blog/Date/201407/Blog/Combining-TypeScript-...
1
vote
1
answer
2k
views
How to start jasmine tests with grunt?
I want to create a grunt task for running jasmine tests automatically when the code changed. For AMD support I installed grunt-template-jasmine-requirejs. I added these lines to my gruntfile:
connect:...
1
vote
0
answers
1k
views
require.config TypeError: undefined is not a function
I want to write some tests with Jasmine. Therefore I first want to load RequireJS.
Thus I put a reference in the Jasmine.json file:
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
...
0
votes
1
answer
128
views
Jasmine test case in maven with requirejs
I want to use jasmine for unit testing javascript application. My application uses requirejs. I found Jasmine maven plugin
This plugin works great for non requirejs application. It also has requirejs ...
2
votes
1
answer
2k
views
Javascript Jasmine Testing: Prevent tested function to call function from object that was created within tested function
I want to test a Javascript function with Jasmine that has a structure like this:
showEditUser: function (...) {
// more code here...
var editUserView = new EditUserView();
// more code ...
1
vote
1
answer
308
views
BlanketJS + Jasmine + RequireJS no code coverage
I am trying to get the same setup as this tutorial.
First Off. My file structure is:
/assests
/css
/font
/img
/js
/collection
/lib
/model
/plugin
/spec
-> Tests in ...
1
vote
2
answers
45
views
How to use RequireJS properly?
I need to test a JavaScript project. There are described several modules but when I try to load them something goes wrong.
define([
'core/BaseModel'
],
function (BaseModel) {
var MessageModel = ...
0
votes
0
answers
180
views
RequireJS error: Timeout
I am testing a JavaScript project with Jasmine. Everything went well but suddenly nothing works anymore although I cannot remember to have changed anything. I get this error:
Error: Timeout - Async ...
0
votes
1
answer
187
views
How can I load a module with RequireJS for testing in a testing framework like Jasmine?
I am new to JavaScript and try to test functions defined in a RequireJS Module.
That means i have some code like this:
define([...], function(...){
var ModuleName = Base.extend({
init: ...
0
votes
1
answer
848
views
Writing Unit Testing With Jasmine , Require JS in Karma for Angular JS?
I have Done a Library Management App with Angular JS and Mongo Lab will Act as a DB Part, I am facing issuse with Require JS Dependency While Crating Unit test Case
Error: [$injector:modulerr] Failed ...