New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

test-machinepack

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-machinepack - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json
{
"name": "test-machinepack",
"author": "Mike McNeil <@mikermcneil>",
"version": "0.2.1",
"version": "0.2.2",
"description": "Raw test runner for machinepacks (also includes a simple stub test driver)",

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

@@ -33,4 +33,29 @@ /**

// Ensure input configuration is ready to use
// (i.e. parse JSON for inputs w/ typeclass/example of dictionary or array)
//
// TODO: replace this with shared logic from relevant code in the `machinepack` CLI
// and in machinepack-machines.
testCase.using = _.reduce(testCase.using || {}, function (memo, configuredValue, inputName) {
var inputDef = machine.inputs[inputName];
if (!inputDef) {
throw new Error('A test specifies a value for an input which does not actually exist in the machine definition (`'+inputName+'`).');
}
if (inputDef.typeclass === 'dictionary' || inputDef.typeclass === 'array' || _.isArray(inputDef.example) || _.isPlainObject(inputDef.example)) {
try {
configuredValue = JSON.parse(configuredValue);
}
catch (e) {
throw new Error('Could not parse the value for the `'+inputName+'` input specified by a test:\n'+e.stack);
}
}
memo[inputName] = configuredValue;
return memo;
}, {});
// Configure the inputs
var machineInstance = machine(testCase.using||{});
var machineInstance = machine(testCase.using);

@@ -37,0 +62,0 @@ // Build an empty `exitsTraversed` array that will track which exit was traversed,

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