Questions tagged [jasmine2.0]

Jasmine is an open source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.

Jasmine is an open source testing framework for JavaScript. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec.

197 questions
0
votes
1 answer

How to get custom message for pass expect in Jasmine

I can able to get custom message for failure expect in Jasmine. But i want to get custom message for pass expect also in Jasmine. I used below code expect(true).toBe(false,'To verify the icon'); Custom Message Expected true to be false, 'To verify…
Nagakesav
  • 1
  • 1
0
votes
1 answer

A better way to handle async tests in jasmine 2

This is an example of three of my tests... describe('Enabled button (no disabled attribute)', function () { var el, clicked = false; beforeEach(function (done) { // Create the tag el = document.createElement('rui-button') …
Justin808
  • 20,859
  • 46
  • 160
  • 265
0
votes
1 answer

Receiving error 'Can't find variable:require' when using Chutzpah/PhantomJS in Visual Studio 2015

First: I have looked at a number of tickets that address similar issues, but I feel that mine is different is a particular respect: I have just installed the Chutzpah test runner in Visual Studio 2015, and I don't know what to expect from that test…
Philip Raath
  • 460
  • 3
  • 18
0
votes
2 answers

Protractor: How to expect browser url to equal url that have an id after registering new user?

I'm making some tests in Protractor and encountered a little problem: I made a test to register a new user, when I finish registering it the url will be something like this: #/user/592/profile So, my question is, how can I manage to get the ID of…
Pablodotjs
  • 37
  • 1
  • 7
0
votes
1 answer

React Jest: How to get the state of checkbox

I'm trying to find the checked status of a checkbox in a React component. This is my component: class Checkboxes extends React.Component { constructor() { super(); console.log('Hello world!'); this.state = { …
Dirty Penguin
  • 4,212
  • 9
  • 45
  • 69
0
votes
0 answers

File Upload on Firefox with Protractor

There have been some answers to this question before and I've tried all of them and but it just isn't clicking for me though. I'm including my file upload function from my protractor page-object and the html it is supposedly working on. Can you…
0
votes
1 answer

How to create Protractor reports with Jasmine2

I have very recently started to use Protractor lib to test angularjs site.I tried to use below 2 libs to create HTML reports but in both cases I got the error https://www.npmjs.com/package/protractor-jasmine2-html-reporter …
Sunny Sachdeva
  • 289
  • 3
  • 16
0
votes
1 answer

How to test that a jasmine custom matcher fails due to an exception in the matcher

I have an odd looking test spec below. expect(function(){ expect(null).not.toEqualMoment(testContext.moment1); }).toThrow(); The inner expectation fails because of the check below inside my custom matcher, which throws an exception.…
Jesse
  • 1,673
  • 1
  • 16
  • 22
0
votes
1 answer

Promise not expecting a resolve or a reject

To test one of my AngularJs Service I was writing to Unit tests. Here is a sample code I've came up with : it('', function(done) { aDocument.retrieveServiceFile(extractedFileFeature) .then(function() { …
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
0
votes
1 answer

Unit testing promises in AngularJS with arguments

We're unit testing our services and facing issue spying on methods with arguments of dependent services. I am writing unit tests for ServiceA ServiceA.js angular.module("App").service("ServiceA", function($http, ServiceB) { this.detail = null; …
svp
  • 495
  • 1
  • 12
  • 26
-1
votes
1 answer

Jasmine - JavaScript: How to check array response by validating one of the array returned data?

What if I want to validate a result from an array response! Response: ({ id: '612d56952ca01806398dac1f', lastUpdated: '2021-08-30T22:07:17.099Z', userToken: 'public', data: Object({ createdOn: '2021-08-30T22:07:16.916Z', lastUpdatedBy: null, userId:…
-1
votes
1 answer

Jasmine - undefined is not a constructor

export default { retrieve() {...}, process: { getData(source) { return this.retrieve({id: source.id}) .then((reply) => { source.reply = reply; return reply }); } …
-1
votes
1 answer

Can we execute one 'it' block from a file on different browsers while other test cases are running on another browser?

In a file I have 5 'it' blocks under single describe block, is a way where I can execute 1 test case always on Chrome browser while executing other 4 on Firefox or IE?
-1
votes
1 answer

Do spies in Jasmine actually call the function they are spying on?

I want to know how the "spyOn" function works internally. I read that the 'spyOn' function internally replaces the implementation of the function being spied on. Does it keep the old functionality? As an example, suppose I wanted to spy on an object…
-2
votes
1 answer

i have problem with protractor when i am trying to execute the test cases in Microsoft edge browser. i am getting error

i am getting this error when i am trying to execute test cases in Microsoft edge browser
1 2 3
13
14