Could you probably help me mocking the Store? I've seen this and this questions by a have a bit different error. I'm using store in one of my services, where I use dispatch, select and get store methods. I've mocked the Store following @noelmace sugg
I am a beginner of angular2. My service.ts will be, import { Injectable } from '@angular/core'; import { Http, Response } from '@angular/http'; import {Headers, RequestOptions, URLSearchParams} from '@angular/http'; import {Observable} from 'rxjs/Obs
My log4js.js file code 'use strict'; var log4js = require('log4js'); var log4jsGen = { getLogger: function getLogger() { log4js.loadAppender('file'); log4js.addAppender(log4js.appenders.file('./ApplicationLogs.log'), 'logs'); var logger = log4js.getL
Version 2 of the JavaScript testing framework jasmine unfortunately introduced several breaking changes. One of these changes is the way custom matchers are handled, as is outlined here: http://jasmine.github.io/2.0/upgrading.html The addMatchers fun
I've been trying to test the process when any request was sended and I want check if the headers are ok. What have I done wrong? check this codepen: http://codepen.io/gpincheiraa/pen/qZPrEp App.js angular .module('exampleApp') .config(configFn); conf
Whenever, I am testing a controller and have something like this in it. $scope.isSomething = function (Item) { return ItemCollection.someItem(Item.attachedItem); }; giving error on karma console: TypeError: undefined is not an object (evaluating 'Ite
I am trying to create a unit test for a service call in my method. The unit test returns the following error: TypeError: Unable to get property 'catch' of undefined or null reference Controller method I am testing: $scope.getAsset = function (id) { i
Currently I'm trying to get Jasmine to run along with Webpack, to execute tests written in typescript to test Angular2 Apps in the Terminal. I researched yesterday which packages are available for testing, and while angular2 has their own approach *1
I'm writing Jasmine Unit test for AngularJS UI grid. I have a below UI grid function in my controller Code: $scope.gridOption.onRegisterApi = function(gridApi) { $scope.gridApi.core.on.sortChanged($scope, function(grid, sortColumns) {}; gridApi.pagin
What is the difference between expect(something).toBe(true), expect(something).toBeTruthy() and expect(something).toBeTrue()? Note that toBeTrue() is a custom matcher introduced in jasmine-matchers among other useful and handy matchers like toHaveMet
I'm using Karma and Jasmine for testing my Angular JS code. I managed to run all the tests in my project using Karma, but if I try to run just a single file I'm getting the following error: ReferenceError: describe is not defined. Is it possible to r
I have the code below and I want test it as much as possible. I'm just scratching my head how to test that two line within the then block of the authenticationService.authenticate(). I have searched back and forth, but I haven't found any usable info
For some reason my assert in protractor fails, what i'm trying to do is get the innerHTML (text) from an element: var stuff = $('css').html(); expect(stuff).toBe("Inner HTML Text here"); I verified that the $().html() yields the text i desire on
is any option for verbore output for testing by jest? I can see which modules are mocked. I tried jasmine.VERBOSE = true; but not working. Thanks for answer.To get verbose mode in Jest, you can run Jest with the --verbose tag. In your packages.json,
I've created a JHipster project and created a javascript spec, however when I run karma start I'm getting this output: ~/projetos/consami/src/test/javascript$ karma start INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/ INFO [lau
I'm using the jasmine-gem as part of a rails project. I know I can run the tests in a browser with rake jasmine, but I need to run them headless via rake jasmine:ci. When I'm running them in headless/ci mode, console.logs do not get outputted. How ca
I am building directive tests in Angular using Jasmine. I have a small example test which looks like this: it("should compare html node", inject( function ($compile, $rootScope) { var elm = angular.element('<input>'); elm = $compile(elm)($
I have as simple "hello world" project and I want to test the famous hélloWorld function. The project is structured like this: ├── package.json ├── spec │ ├── helloWorldSpec.js │ └── support │ └── jasmine.json └── src └── helloWorld.js And the f
I'm a little screwed up with angular / jasmine / promise / mocking testing. I have a piece of code: factory.login = function(user, pwd) { AuthenticationResource.login( {}, {"username" : user, "password" : pwd}, factory.onLoginSuccess,
I'm currently running my test suite on AngularJS using Grunt, Karma, Jasmine and Protractor. The database library I'm using is hood.ie, which is a library on top of CouchDB. I start hood.ie using the following code in my Gruntfile: hoodie: { start: {
I've inherited a medium sized angular app. It looks pretty well organized and well written but there's no documentation or unit tests implemented. I'm going to make an effort to write unit tests posthumously and eventually work in e2e tests and docum
I had a working implementation of karma-based tests without requirejs, and I decided I should add requirejs to it before it got too large. I'm not sure what I did, but I'm now getting an error message that I don't understand. The one complaint I have
I am trying to test an Angular service which wraps my API calls. For testing I'm using Jasmine and Karma. My test looks like this: describe('$http basic', function () { var ConcernService, $httpBackend, $scope; beforeEach(module('concernsApp')); befo
I am using Backbonejs 0.9.2 with Titanium Alloy and I need to remove all the completed tasks from a Collection. Backbone.sync is configured to use a SQLite local database. extendCollection: function(Collection) { exts = { self: this , fetchComplete:
I have this unit spec in jasmine: define(['common/components/directives/directives', 'angular'], function (directives, ng) { describe('The directives module', function () { beforeEach(function () { ng.mock.module('directives'); }); describe('The tabs
After a brief romance with the revealing module pattern I've come to realise a set-back when it comes to unit-testing modules. I cannot however decide if it is my approach to testing a module or whether there is some form of work-around. Consider the
I am currently trying to run JSCover in web server mode to determine the coverage of my Jasmine tests that are executed in the PhantomJS headless browser. I am also using grunt+nodejs to kick off the tests. The code I use in my gruntfile to start the
How can I tell the Jasmine spy to only listen the messages I tell it to expect and ignore any others? For example: Example Group describe 'View', -> describe 'render', -> beforeEach -> @view = new View @view.el = jasmine.createSpyObj 'el', ['appe
I have a bunch of failing specs from a rather large architectural change. I'd like to work on fixing them one by one by tagging each one with 'focus'. Does jasmine.js have a feature like this? I swore I read at one point that it does but I don't see
Are there any end user example projects that use best practices of javascript testing frameworks jasmine-node / jasmine. Something like a simple CRM, rss reader etc..Check out the Diaspora project, which uses jasmine for testing.