Most voted "jasmine" questions
Jasmine is a behavior-oriented development (BDD) unit testing framework for Javascript unit code testing. Jasmime has no external dependency and does not require a DOM.
Learn more…24 questions
Sort by count of
-
15
votes3
answers2138
viewsHow to perform unit tests on nodejs
I’d like to run unit tests on Node.js, I’m using the grunt-jasmine, but it does not recognize the variable exports, module and neither required. Is there a way to solve this or does someone suggest…
-
4
votes1
answer123
viewsWhen to do unit tests in Javascript?
As far as it is advantageous to do unit testing in the presentation layer, and, what would be the scenarios where unit testing in Javascript is advantageous? Only advantageous if you have…
-
4
votes1
answer242
viewsIs testing the interaction with html and Javascript using Jasmine wrong?
Javascript code has some interactions with html like this example: function retornaListaDeItens(argument) { return document.getElementsByClassName(argument); } I use the return of this function to…
-
3
votes1
answer105
viewsTest if method removes a list item (Jasmine)
I have a method in a service that removes items over 60 days from a list. self.removerAntigas = function () { var dataCorte = new Date(); var dataAux = dataCorte.getDate(); dataCorte.setDate(dataAux…
-
3
votes1
answer173
viewsHow to Refactor Legacy JS to Implement Unit Tests?
I have a Wordpress site with many JS files that have not been structured to be tested - they have not been written as modules that can be imported nor is there a app.js that loads them all as a…
javascript unit-testing refactoring jasmine jestasked 6 years, 6 months ago Ricardo Moraleida 4,005 -
2
votes1
answer51
viewsTesting Jasmine in separate files without breaking the describe?
I want to organize my javascript tests in separate files, but these can be part of a common module. For example: describe("Controllers", function () { describe('Move list Controller', function () {…
-
2
votes0
answers108
viewsPlugin Execution not covered by Lifecycle Configuration
I have implemented unit tests in my application using Jasmine and I want to configure a continuous integration in Maven so that the tests run automatically. Already working, however an error is…
-
1
votes0
answers89
viewsCall test script function [Protractor]
Hello, I have a file that calls several test methods that I created with Protractor, it looks like this: import {MeuCadastro} from './MeuCadastro/MeuCadastro.spec'; import {Rotas} from…
-
1
votes0
answers286
viewsError when testing GET method with Jasmine/Angular
I am trying to compare the type of method when there is a call with the api url. import { async, ComponentFixture, TestBed, getTestBed } from '@angular/core/testing'; import {…
-
1
votes1
answer191
viewsTest of default in Angulajs application using Karma and Jasmine
Hello, I have an application in Angularjs and I wanted to ensure the quality of my code by doing unit tests and I am using Karma and Jasmine for this. After having had a certain difficulty to…
-
1
votes1
answer644
viewsUnit Service Testing Using Karma (typescript/angular)
I’m trying to test a service GET method: get(url: string, params?: any): Observable<Response> { let options = {}; this.securityService.setHeaders(options); if (params) this.setParams(options,…
-
0
votes0
answers170
viewsHTML (DOM) testing with Jasmine or other framework
How do I test HTML with Jasmine? I know there’s a guy named jquery-Jasmine.js who does this but I have no idea how to install it because npm doesn’t work when I try to install it (it says that Git…
-
0
votes0
answers279
viewsHow to test private functions?
I have a controller with some functions: angular.module('teste.controllers') .controller(TestCtrl, function($scope){ var vm = this; vm.funcTest = function(){ return 1 + 1; } function _testSoma2(){…
-
0
votes1
answer48
viewstest filter scenario
I would like to know the best way to test (with Jasmine) a filter with this scenario: function districtFilter(city, array) { var districtFound = array.filter(function(a) { return a.id !== city.id;…
-
0
votes1
answer312
viewsKarma unit tests (typescript/angular)
I am trying to perform a unit test for a method made in typescript, this is the method: createTasksForms(): void { this.task.forEach(task => { task.form = this.form.group({ name: ['',…
-
0
votes1
answer270
viewsUnit Karma Test for Typescript/Angular Method
I’m having trouble testing a method of select, that’s the method: select(task): any { (document.getElementById(task) as HTMLInputElement).select(); }; It is called by html, in this part here:…
-
0
votes1
answer32
viewsWebdrivererror when running E2E tests with Protractor/Selenium
Error occurring below when running E2E test specs, no action previously done that may have caused the error. That is the mistake: [14:20:03] I/testLogger - PID: 16221 Specs:…
-
0
votes1
answer84
viewsDependency injection problems in Angular unit tests
I’m trying to perform unit tests in Angular, but I have some problems with injection dependencies in the services. In the application there are several services that depend on each other, for…
-
0
votes1
answer26
viewsJasmine is not recognizing the getCurrentNavigation() function
I’m trying to test a component that uses function getCurrentNavigation() of the Router to pick up data via navigation. My component is working normally with the expected purpose when I run with ng…
-
0
votes1
answer23
viewsERROR Nullinjectorerror: R3injectorerror(Dynamictestmodule)[Kdsdialogservice -> Matdialog -> Matdialog]: Nullinjectorerror: No Provider for Matdialog
I am doing unit testing in an application of mine. I am beginner regarding testing, so I need your help. In my application I do a service using Matdialog ( Kdsdialogservice). I have tried putting…
-
0
votes0
answers19
viewsHelp Test Controller Angularjs and Jasmine
Good morning guys, I need a help to do the unit test of a controller with Jasmine, my problem is that I need to cover the methods of this controller and I am not able to do the right way to get…
-
-1
votes1
answer52
viewsError testing Activatedroute with angular jest 9
First thank you for reading my question! Setting: I’m testing an angular 9 application with jest of a component using a solver class'. I tried to set up a mock to resolve it, but when running tests…
-
-2
votes1
answer100
viewsJasmine error - Uncaught [Object Object] thrown
When I run my test I get the following error Uncaught [object Object] thrown Every time the test is run he says the error is in a different location, I can’t understand the reason. Sometimes the…
-
-2
votes1
answer14
viewsTesting of a component function
I don’t understand how I could test this function of Component, I’ve tried some ways, but I really didn’t understand how to do Function in the Component: openModal(){ if(this.RecommendationCount…