loadtest 8.0.5 → 8.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/options.js CHANGED
@@ -132,7 +132,8 @@ async function readBody(filename) {
132
132
  throw new Error(`Invalid file to open for body: ${filename}`);
133
133
  }
134
134
  if (path.extname(filename) === '.js') {
135
- return await import(new URL(filename, `file://${process.cwd()}/`))
135
+ const fn = await import(new URL(filename, `file://${process.cwd()}/`));
136
+ return 'default' in fn ? fn.default : fn;
136
137
  }
137
138
  return await readFile(filename, {encoding: 'utf8'});
138
139
  }
package/lib/tcpClient.js CHANGED
@@ -70,7 +70,8 @@ export class TcpClient {
70
70
  const line = `${header}: ${value}`
71
71
  lines.push(line)
72
72
  }
73
- lines.push(`\r\n`)
73
+ lines.push('')
74
+ lines.push(body)
74
75
  const text = lines.join('\r\n')
75
76
  return Buffer.from(text)
76
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loadtest",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "type": "module",
5
5
  "description": "Run load tests for your web application. Mostly ab-compatible interface, with an option to force requests per second. Includes an API for automated load testing.",
6
6
  "homepage": "https://github.com/alexfernandez/loadtest",
@@ -80,7 +80,7 @@ function testWSIntegration(callback) {
80
80
  }
81
81
  const options = {
82
82
  url: `ws://localhost:${port}`,
83
- maxRequests: 10,
83
+ maxRequests: 100,
84
84
  concurrency: 10,
85
85
  body: {
86
86
  /*