loadtest 8.0.4 → 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 +5 -1
- package/lib/tcpClient.js +2 -1
- package/package.json +1 -1
- package/test/integration.js +1 -1
package/lib/options.js
CHANGED
|
@@ -71,6 +71,9 @@ class Options {
|
|
|
71
71
|
if (options.data) {
|
|
72
72
|
this.body = options.data
|
|
73
73
|
}
|
|
74
|
+
if (options.body) {
|
|
75
|
+
this.body = options.body
|
|
76
|
+
}
|
|
74
77
|
// Allow a post body string in options
|
|
75
78
|
// Ex -P '{"foo": "bar"}'
|
|
76
79
|
if (options.postBody) {
|
|
@@ -129,7 +132,8 @@ async function readBody(filename) {
|
|
|
129
132
|
throw new Error(`Invalid file to open for body: ${filename}`);
|
|
130
133
|
}
|
|
131
134
|
if (path.extname(filename) === '.js') {
|
|
132
|
-
|
|
135
|
+
const fn = await import(new URL(filename, `file://${process.cwd()}/`));
|
|
136
|
+
return 'default' in fn ? fn.default : fn;
|
|
133
137
|
}
|
|
134
138
|
return await readFile(filename, {encoding: 'utf8'});
|
|
135
139
|
}
|
package/lib/tcpClient.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loadtest",
|
|
3
|
-
"version": "8.0.
|
|
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",
|