testkit
v0.1.1
Published
Private testing toolkits
Downloads
7
Readme
Testkit
Testing toolkit and micro frameworks
Componets
Web
testkit.web.createHttpServer([secured], [handler])
Create a http(s) server. If handler is not given, it will respond to any requests with a simple string of http or https depends if it's secured or not.
testkit.web.createWebsocketServer(secured)
Create a websocket server.
testkit.web.createServerGroup(type, num, [secured])
Create a group of servers
typeis one ofwsorhttpnumis the total number of server to be created
testkit.web.listen(servers, startPort, [callback])
serversis an array of http(s) or websocket serversstartPortis the port that the first server in the array will listen on; the second server will listen on the port ofstartPortplus one, and so on.
testkit.web.close(servers, [callback])
serversis an array of servers to be closed
testkit.web.attack(url, num, [callback])
Concurrently initiated requests against an URL.
urlis the target URLnumis the total number of requests to be createdcallbackis fired everytime a request is finished and response is got. As it usesmikeal/requestunder the hood, see the docs of request to get more information about the callback
License
MIT
