Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
mole-rpc-autotester
Advanced tools
Automatic tester for Mole-RPC (JSON-RPC library) transports.
If you writes own transport for Mole-RPC then use this module to be sure that your transport covers as expected.
This module does end-to-end testing and will:
This modules covers a lot of cases but it does not help you with detecting memory leaks, reconnection problems etc.
This example covers almose all of the API of the module.
Do not forget to add 'mole-rpc' and 'mole-rpc-autotester' to devDependencies of your transport's package.json.
const AutoTester = require('mole-rpc-autotester');
const MoleClient = require('mole-rpc/MoleClient');
const MoleClientProxified = require('mole-rpc/MoleClientProxified');
const MoleServer = require('mole-rpc/MoleServer');
const X = require('mole-rpc/X');
// Import your transport
const TransportClient = require('./TransportClient');
const TransportServer = require('./TransportServer');
async function main() {
const server = await prepareServer();
const clients = await prepareClients();
const autoTester = new AutoTester({
X,
server,
simpleClient: clients.simpleClient,
proxifiedClient: clients.proxifiedClient
});
await autoTester.runAllTests();
}
async function prepareServer() {
return new MoleServer({
transports: [
// initialize your transports
new TransportServer(...)
]
});
}
async function prepareClients() {
const simpleClient = new MoleClient({
requestTimeout: 1000, // autotester expects this value
transport: new TransportClient(...) // initialize your transport
});
const proxifiedClient = new MoleClientProxified({
requestTimeout: 1000, // autotester expects this value
transport: new TransportClient(...) // initialize your transport
});
return { simpleClient, proxifiedClient };
}
main().then(console.log, console.error);
You can find more tranports here
FAQs
Automatic tester for mole-rpc transport packages
The npm package mole-rpc-autotester receives a total of 4 weekly downloads. As such, mole-rpc-autotester popularity was classified as not popular.
We found that mole-rpc-autotester demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.