jasmine2.0 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...

4

Solved

I have a method which is being called using a d3 timer. Whenever the method is called, the method emits an object with a couple of values. One of the values increases over time. I would like to wr...
Wiegand asked 8/8, 2017 at 22:30

2

Solved

According to the Angular Testing documentation, to trigger the events from the tests, we use the triggerEventHandler() method on the debug element. This method takes the event name and the object. ...
Janettjanetta asked 22/8, 2017 at 18:19

1

I've recently upgraded my projet from angular 7 to angular 9. When I run the tests (ng test), I always get http://localhost:9876/_karma_webpack_/ appendend to the error, hence in visual studio code...
Anastrophe asked 15/5, 2020 at 13:1

2

I am using Visual Studio code, Protractor, Typescript and Jasmine framework. I have spec test cases within "it" block. To see all the test cases or it blocks I have installed "Jasmine Test Explor...
Putdown asked 26/6, 2018 at 11:16

3

Solved

I've struggled in problem with my e2e tests runs on selenium grid. Sometimes the tests are failed due to Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAUL...

1

Is there a way to have "no-floating-promises" turned on but let it ignore Jasmine promises like "toEqual", "toBe", etc.? I want to use it, but it complains about my expect statements all over the p...
Eulogium asked 8/7, 2019 at 16:13

2

I am testing a controller that uses a service that returns a promise. I need to resolve promise. I am using Jasmine 2. Here is Spec code beforeEach(inject(function ($controller, $rootScope, _...
Orozco asked 5/12, 2018 at 9:34

2

Solved

I have a service with 2 properties: Service ... public usernameAnnounced; private username: Subject<string> = new Subject<string>(); constructor() { super(); this.usernameAnnounced...
Debussy asked 5/7, 2018 at 12:46

2

Solved

I'm trying to test my chrome extension with Jasmine but I'm having trouble getting calls.length and callCount to behave as expected. Both cases return undefined. I've included a sample of the code...

2

Solved

I'm using a Jasmine (2.2.0) spy to see if a certain callback is called. Test code: it('tests', function(done) { var spy = jasmine.createSpy('mySpy'); objectUnderTest.someFunction(spy).then(func...
Bluebird asked 21/7, 2015 at 13:0

1

Solved

I'm new to protractor. How does async/await in this function works? Can anybody explain it to me? it('TC_01 - Verify Home page title', async () => { await headerPage.waitForTitleContain('Homep...
Kerianne asked 22/6, 2017 at 6:39

1

How can I spy on MyFunction and return 2 in Jasmine 2.0? I have the following code that errors on the first line inside shouldPass with: Error: function MyFunction(){ return 1; }() method does ...
Pyrology asked 26/5, 2017 at 14:42

4

I maintain a complex Angular (1.5.x) application that is being E2E tested using Protractor (2.5.x). I am experiencing a problem with this approach, which presents primarily in the way the tests see...
Photoperiod asked 26/7, 2016 at 9:52

2

Solved

I'm working with a system that has several external system dependencies. These external systems are only hooked into certain SDLC environments (local, dev, qa, and prod). Due to these restrictions,...
Pettifogging asked 8/9, 2015 at 14:25

3

Solved

I know that calling $digest or $apply manually during a digest cycle will cause a "$digest already in progress" error but I have no idea why I am getting it here. This is a unit test for a service...
Sniperscope asked 21/6, 2014 at 12:19

1

I know this question have been solved but it doesn't work for me. I upgrade to protractor4.0.9/Jasmine2, chromedriver 2.25, Chrome54. A simple test like this is failing: describe('Test', () =&gt...
Speciosity asked 25/10, 2016 at 11:23

1

Solved

This code in my protractor config file works perfectly... except that the html file creation in onComplete always uses the junitresults xml file from the previous test run, instead of the xml file ...
Wadding asked 12/1, 2016 at 14:51

1

Solved

I don't want to read code for hours to find the relevant part, but I am curious how jasmine implements its clock. The interesting thing with it is that it can test async code with sync testing code...
Ipomoea asked 5/3, 2015 at 23:5
1

© 2022 - 2024 — McMap. All rights reserved.