Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loadmill

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loadmill - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

1

index.d.ts

@@ -19,3 +19,4 @@ export = Loadmill;

run(config: Loadmill.Configuration, paramsOrCallback?: Loadmill.ParamsOrCallback, callback?: Loadmill.Callback): Promise<string>;
wait(loadTestId: string, callback?: Loadmill.Callback): Promise<Loadmill.TestResult>;
runFunctional(config: Loadmill.Configuration, paramsOrCallback?: Loadmill.ParamsOrCallback, callback?: Loadmill.Callback): Promise<Loadmill.TestResult>;
};

@@ -30,2 +30,48 @@ "use strict";

},
wait: function (loadTestId, callback) {
var _this = this;
var _resolve, _reject;
var intervalId = setInterval(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var result, testResult, err_1;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, superagent.get("https://www.loadmill.com/api/tests/" + loadTestId)
.auth(token, '')];
case 1:
result = (_a.sent()).body.result;
if (result) {
clearInterval(intervalId);
testResult = {
id: loadTestId,
passed: result === 'done',
url: "https://www.loadmill.com/app/test/" + loadTestId
};
if (callback) {
callback(null, testResult);
}
else {
_resolve(testResult);
}
}
return [3 /*break*/, 3];
case 2:
err_1 = _a.sent();
if (callback) {
callback(err_1, null);
}
else {
_reject(err_1);
}
return [3 /*break*/, 3];
case 3: return [2 /*return*/];
}
});
}); }, 10 * 1000);
return callback ? null : new Promise(function (resolve, reject) {
_resolve = resolve;
_reject = reject;
});
},
runFunctional: function (config, paramsOrCallback, callback) {

@@ -32,0 +78,0 @@ var _this = this;

2

package.json
{
"name": "loadmill",
"version": "0.0.13",
"version": "0.0.14",
"description": "A node.js module for running load tests and functional tests on loadmill.com",

@@ -5,0 +5,0 @@ "keywords": [

@@ -46,2 +46,44 @@ import * as fs from 'fs';

wait(loadTestId: string, callback?: Loadmill.Callback): Promise<Loadmill.TestResult> {
let _resolve, _reject;
const intervalId = setInterval(async () => {
try {
const {body: {result}} = await superagent.get(`https://www.loadmill.com/api/tests/${loadTestId}`)
.auth(token, '');
if (result) {
clearInterval(intervalId);
const testResult = {
id: loadTestId,
passed: result === 'done',
url: `https://www.loadmill.com/app/test/${loadTestId}`,
};
if (callback) {
callback(null, testResult);
}
else {
_resolve(testResult);
}
}
}
catch (err) {
if (callback) {
callback(err, null);
}
else {
_reject(err);
}
}
},
10 * 1000);
return callback ? null! as Promise<any> : new Promise((resolve, reject) => {
_resolve = resolve;
_reject = reject;
});
},
runFunctional(

@@ -48,0 +90,0 @@ config: Loadmill.Configuration,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc