MCPcopy Create free account
hub / github.com/avoidwork/tenso / startServer

Function startServer

benchmarks/load-test.js:101–117  ·  view source on GitHub ↗

* Starts a server and waits for it to be listening * @param {Object} server - The Tenso server instance * @returns {Promise } Promise that resolves with the server instance when listening

(server)

Source from the content-addressed store, hash-verified

99 * @returns {Promise<Object>} Promise that resolves with the server instance when listening
100 */
101function startServer (server) {
102 return new Promise((resolve, reject) => {
103 server.start();
104
105 if (server.server) {
106 server.server.on("listening", () => {
107 resolve(server);
108 });
109
110 server.server.on("error", err => {
111 reject(err);
112 });
113 } else {
114 reject(new Error("Server was not created"));
115 }
116 });
117}
118
119/**
120 * Runs a load test with autocannon

Callers 4

rateLimitLoadTestsFunction · 0.85
hypermediaEnabledTestsFunction · 0.85
hypermediaDisabledTestsFunction · 0.85
mainFunction · 0.85

Calls 1

startMethod · 0.80

Tested by

no test coverage detected