jasmine

jenkins Error sending to the following INVALID addresses:xxx@yyy.com

 ̄綄美尐妖づ 提交于 2019-12-10 03:54:38
问题 Jenkins gives following after completing test execution: Error sending to the following INVALID addresses: valid emailid jenkins build log: Build step 'Execute shell' marked build as failure Email was triggered for: Failure Sending email for trigger: Failure Sending email to: valid emailid Error sending to the following INVALID addresses : valid emailid Finished: FAILURE 回答1: I was getting this error too, and in the build log Jenkins displayed the "invalid address" error, but listed a valid

How do you reference external libraries with Jasmine + Resharper

房东的猫 提交于 2019-12-10 03:19:21
问题 I can run Jasmine unit tests from the Resharper 8.0 unit test runner. I have a problem where any Javascript references that are normally in the html page (ie in my case Ext-Js) then I can't use the Resharper test runner, as you don't seem to have access to the HTML page that Resharper uses. (I assume it's generated as I could not locate it on disk) I was thinking if there is a way to call or load your external library references from the Javascript test file directly instead of via the html

Write angular2 tests and changing the mock return values - make it DRY?

五迷三道 提交于 2019-12-10 03:09:04
问题 I'm writing some tests for a service and I'm altering the response from mock functions to test various cases. At the moment, every time I want to change the response of a mock, I need to reset the TestBed and configure the testing module again, injecting my new Mocks as dependencies. I feel like there must be a DRYer way to write this spec, but I can't figure it out. Does anyone have any ideas? (I understand that I could write tests for this service as a standard ES6 class, but I get the same

Jenkins integration with Jest

跟風遠走 提交于 2019-12-10 02:58:57
问题 Is there a way to have Jenkins integration in the Javascript Jest testing framework that is built on top of Jasmine? I've tried to integrate Jest with jasmine-reporters, but didn't manage to get a JUnit XML output. I installed the reporters for Jasmine 1.3 with npm install jasmine-reporters@~1.0.0 and then in my setupTestFrameworkScriptFile : require('jasmine-reporters'); jasmine.VERBOSE = true; jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter({ savePath: "output/" })); When I run

Promise.catch() does not catch exception in AngularJS unit test

拟墨画扇 提交于 2019-12-10 02:14:10
问题 I am writing Jasmine unit tests for my app in Typescript and running them via Resharper. It is supposed to execute an action if the handler throws an exception: describe("Q Service Test", () => { var q: ng.IQService; var rootScope: ng.IRootScopeService; beforeEach(inject(($q, $rootScope) => { q = $q; rootScope = $rootScope; })); it("Caught exceptions are handled properly", () => { var state = 'ok'; q.when(1) .then(() => { throw new Error("test exception"); }) .catch(() => { state = 'error'; }

How do I fake-time a jQuery animation using Sinon in a Jasmine unit test?

风流意气都作罢 提交于 2019-12-10 01:09:05
问题 I have a 1 second jQuery .animate action that launches 5 seconds after page load. I set up a Sinon timer in my Jasmine unit testing code and test after a tick of 7 seconds to see if the post-animation properties are as they should be. It doesn't work right, so I've placed an instance of the animation itself on my Jasmine HTML test page to better see what's going on. In Firefox and Chrome, the page loads, the animation function is called, the unit test immediately fails, and then (also

How can I set the viewport size of PhantomJS through grunt & jasmine?

此生再无相见时 提交于 2019-12-10 00:23:30
问题 I'm trying to test something using grunt + jasmine + phantomjs. This specific test requires a large viewport so the responsive styles render the large-screen version within phantomjs. I noticed in the grunt-contrib-jasmine plugin this code, which would seem to allow for setting phantomjs options: // Merge task-specific options with these defaults. var options = this.options({ ... phantomjs : {}, ... }); However, when I add this to my config in grunt it has no effect: options: { phantomjs: {

Can the time out issue be the consequence of browser.sleep() and browser.waitForAngular?

会有一股神秘感。 提交于 2019-12-09 20:38:20
问题 In protractor scripts i'm always having problem of time out, even if i put a big time out jasmine interval , allscripttimeout ... And in some places i'm obliged to wait until element are present like in home page until the url is totally loaded. Can the time out issue be the consequence of browser.sleep(time_ms); browser.waitForAngular(); If so, how can i fix this problem ? Here the problem in details Thanks, 回答1: Yes they could be -- browser.sleep() would only timeout if you had it sleep

How to test JavaScript with DOM elements using jasmine?

百般思念 提交于 2019-12-09 19:30:43
问题 I am trying to write a test in jasmine for JavaScript code including DOM elements which doesn't work. It works when I test only for JavaScript code (just simple functions but not for DOM elements). I have been researching for so long and can't really find the answer. I also tried to use jsdom as it's supposed to be used when testing for DOM elements, however I keep getting a bunch of errors. Is there any 'easy' way to test DOM elements only using jasmine? JavaScript: var result; var adding =

Tags Protractor + Jasmine to run set of suites

时光总嘲笑我的痴心妄想 提交于 2019-12-09 16:50:18
问题 I'm trying to figure out a way to use in the same way, or better said, similar way, the tagging options that cucumberJS has with protractor , but with Jasmin e, is there a way to tag the different scenarios, like: @smoke , @regression , etc.. and then tell on console to run with those? I'm declining to use Cucumber , since it's support it's seems to be getting flaky! Any help will be much appreciated! 回答1: With jasmine2 you can filter tests using a regular expression. Maybe you can add