Questions tagged as 'jasmine'

3
answers

How to perform unit tests on nodejs

I would like to do unit tests on Node.js , I am using grunt-jasmine , but it does not recognize the variable exports , module and nor required . Is there a way to solve this or does someone suggest a testing framewor...
asked by 11.12.2013 / 19:28
2
answers

Angularjs - test assignment of a variable in $ scope in an asynchronous function

I want to test the following scenario: I have a scope: var scope; beforeEach(inject(function($rootScope) { scope = $rootScope.$new(); })); You need to test whether the assignment of a variable in the $ scope within an asynchronous fun...
asked by 22.02.2014 / 03:10
1
answer

Testing the interaction with html and JavaScript using Jasmine is wrong?

JavaScript code has some html interactions like this example: function retornaListaDeItens(argument) { return document.getElementsByClassName(argument); } I use the return of this function to perform operations in JavaScript, performing u...
asked by 27.01.2016 / 01:24
1
answer

Test if method removes item from list (Jasmine)

I have a method in a service that removes items older than 60 days from a list. self.removerAntigas = function () { var dataCorte = new Date(); var dataAux = dataCorte.getDate(); dataCorte.setDate(dataAux - 60);...
asked by 29.05.2015 / 18:41
1
answer

When to do unit tests in JavaScript?

As far as it is advantageous to do unit tests on the presentation layer, what are the scenarios where Javascript unit testing is advantageous? Is it only advantageous if you have calculations in Javascript? Obs : I'll use Jasmine for test...
asked by 07.12.2017 / 12:50
1
answer

Jasmine tests on separate files without breaking the describe?

I want to organize my javascript tests on separate files, but these can be part of a common module. For example: describe("Controllers", function () { describe('Move list Controller', function () { //ListController its });...
asked by 31.10.2014 / 13:06
0
answers

How to refactor JS legacy to implement Unit Tests?

I have a WordPress site with lots of JS files that were not structured to be tested - they were not written as modules that can be imported nor is there a app.js that loads all of them as a framework. The files are only compiled and mi...
asked by 27.06.2018 / 14:47
0
answers

Plugin execution not covered by lifecycle configuration

I have implemented unit tests using Jasmine in my application and want to configure in Maven a continuous integration so that the tests run automatically. It is already working, however an error is appearing in the Eclipse console and I would li...
asked by 17.03.2016 / 13:49
0
answers

Error testing GET method with Jasmine / Angular

I'm 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 { ServiceOrderTypesComponent } from './service-order-types.com...
asked by 04.10.2018 / 17:18
0
answers

How 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(){ return 2 + 2; } })...
asked by 15.09.2015 / 16:46