mocha-web-velocity

Catching Mocha timeouts

落爺英雄遲暮 提交于 2020-01-25 04:12:45
问题 I'm writing a node.js web service which needs to communicate with another server. So its basically server to server communication. I don't have any previous experience of writing web services so I have very limited knowledge. For unit tests I'm using Mocha. Now, I intend to test the behavior of my service for a particular scenario when this other server doesn't respond to my GET request and the request is actually timed out. For tests I've created a fake client and server around my web

how to test showing an element after a click?

微笑、不失礼 提交于 2019-12-10 22:07:22
问题 I'm working with mocha unit test and I need to test if an element is visible after click on a radio button. In other words I have two radio buttons that toggle two elements using javascript and I would like to test this. this is my test: it("Checking #completed-task existance", function (done) { chai.assert.equal($("#completed-task").length, 1); done(); }); it("Checking #completed-task is visible", function (done) { $("#master div.onoffswitch").find("input[data-id='completed-task']").click();