jasmine-jquery Questions

2

Solved

I have 3 tests, each testing various methods. it('test function1', function() { spyOn(document, 'getElementById'); // ... some code to test function1 expect(document.getElementById).toHaveBeen...

2

Solved

JS var link = this.notificationDiv.getElementsByTagName('a')[0]; link.addEventListener('click', function (evt){ evt.preventDefault(); visitDestination(next); }, false); } var visitDestination...
Columbium asked 20/9, 2016 at 20:44

2

Solved

I'm writing a simple click handler and need the event passed in (like so) Thing = function($){ var MyObject = function(opts){ this.opts = opts; }; MyObject.prototype.createSomething = functi...
Mellifluous asked 17/7, 2012 at 19:5

1

Solved

This is my first question to Stack Overflow and Jasmine is fairly new to me, so I hope I'm doing ok here. I have a Jasmine test where I try to set the scroll position of my page to a certain value...
Zasuwa asked 7/11, 2014 at 18:3

1

Solved

Hello I got a question regarding unit testing with Jasmine (plugin: jQuery) How could I test if the object is within the DOM of a document. The thing is that I use a tooltip function which will on...
Rosenberg asked 23/7, 2015 at 14:38

4

I'm trying to implement view tests for a Coffeescript implementation of the ubiquitous backbone.js 'todo' example (see github.com/rsim/backbone_coffeescript_demo.) My jasmine tests of the above de...
Gianina asked 28/9, 2011 at 23:14

2

Solved

What I want to do: We are writing some tests for an existing Javascript code base that uses jQuery heavily. For the tests, we don't want to have actual HTML elements (HTML fixtures). We'd prefer it...
Fingerprint asked 21/6, 2015 at 11:28

2

Solved

I need help working with the toBeHidden() and toBeVisible() methods of jQuery-Jasmine. When a user checks a checkbox, a text field should slide down -- and unchecking slides it up. The text field ...
Chap asked 29/10, 2013 at 19:10

4

I want do something before all tests, then after? What is the best way to organize my code? For example: backup some variables -> clear them -> test something -> restore backups. 'beforeEach' and '...
Tishatishri asked 12/2, 2014 at 11:18

1

Solved

I am using karma + jasmine + jquery + jasmine-jquery I have several pure js unit tests and now it's time to move on to write some html dependent tests. I tried jasmine-jquery and its loadFixtures, ...
Infernal asked 17/2, 2015 at 13:17

3

Solved

I'm writing some simple jasmine tests and I'm getting an exception since the code I'm testing is looking for a form that doesn't exist because there's no DOM when testing a js file only: $("form")[...
Corroboration asked 11/1, 2013 at 16:2

1

Solved

Having real trouble getting a simple example to work. I am using this example taken from https://gist.github.com/Madhuka/7854709 describe("Test for spies", function() { function sendRequest(callb...
Stereochromy asked 2/12, 2014 at 0:21

1

I'm using Yeoman+Angular Generator for my application and I have been running around hard to get along with Jasmine! This is where I am stuck. I want to be able to use jQuery selectors with Jasmine...
Lighten asked 15/9, 2014 at 12:19

1

Solved

I am trying to configure Karma to use jasmine-jquery without success ... In my karma.conf.js file I have configured the framework: frameworks: ['jasmine'], and have loaded the required dependen...
Gulp asked 15/8, 2014 at 13:7

1

Solved

I am covering this part of system with tests at the moment, I have events chained in a way that stopping propagation on first must cancel second event from firing. $.fn.extend({ OnTheMoveBCTrigger...
Basseterre asked 12/6, 2014 at 16:51

1

Solved

Fixtures are working fine for my test suites in jasmine.js version 1.3.1. After upgrading Jasmine.js version to 2.0.0, fixtures are not working. Can anyone explain, how to make my code workable for...
Kennie asked 15/5, 2014 at 13:41

1

I am new to Angularjs framework and also testing it using Jasmine framework and Karma. I have a ASP.NET MVC app built with Visual Studio 2013 and I would like to include Jasmine package and Karma i...
Enlightenment asked 21/3, 2014 at 15:56

1

Solved

Given the following directive directive('myDirective', function() { return { restrict: 'A', scope: {}, replace: false, template: '<input ng-focus="onFocus()" type="text" />', link: fun...
Scarface asked 28/1, 2014 at 16:17

2

I've been trying to find an answer to this at least for the last two hours without any luck. I hope someone here might be able to help. I'm getting this ReferenceError: Can't find variable: $ when...

1

Solved

My controller has code like below: $q.all([qService.getData($scope.id), dService.getData(), qTService.get()]) .then(function (allData) { $scope.data1 = allData[0]; $scope.data2 = allData[1]; $s...

1

Solved

I am having some trouble implimenting spying in Jasmine I want to check if a link has been clicked on a slider using a jasmine spy and jasmine jquery. Here is a simplified version: I have some l...
Freaky asked 26/7, 2013 at 11:31

1

I've just recently started writing something with AngularJS and I'm not sure how to go about writing a test for this particular thing. I'm building a "Help Request" mode that has different states. ...
Photoflood asked 14/6, 2013 at 15:49

2

The single page application I am working on has a login view with two forms: a sign-in form and a sign-up form. The following spec describes tests for these forms. I am using Jasmine-jQuery 1.4.2. ...

1

Solved

My example of spying on a method is failing with "Expected spy handle_click to have been called." when it should pass. However, I am getting the console log "Foo handle_click called!", so I know it...
Robichaud asked 11/5, 2013 at 22:21

3

Solved

I have lots of Jasmine unit tests, that are running unit tests for Javascripts code. They are using Jasmine-jquery plugin to do DOM manipulation. they use loadFixture, to load fixtures of HTML I t...
Fateful asked 19/9, 2011 at 20:3

© 2022 - 2024 — McMap. All rights reserved.