testkit
v0.1.1
Published
Private testing toolkits
Downloads
3
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
type
is one ofws
orhttp
num
is the total number of server to be created
testkit.web.listen(servers, startPort, [callback])
servers
is an array of http(s) or websocket serversstartPort
is the port that the first server in the array will listen on; the second server will listen on the port ofstartPort
plus one, and so on.
testkit.web.close(servers, [callback])
servers
is an array of servers to be closed
testkit.web.attack(url, num, [callback])
Concurrently initiated requests against an URL.
url
is the target URLnum
is the total number of requests to be createdcallback
is fired everytime a request is finished and response is got. As it usesmikeal/request
under the hood, see the docs of request to get more information about the callback
License
MIT