
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
test-machinepack
Advanced tools
Raw test runner for machinepacks (also includes a simple stub test driver)
Raw test runner for machinepacks (also includes a generic driver)
Note that this built-in test driver is pretty basic-- I wouldn't recommend using it. There is a better driver for mocha that you might enjoy: https://github.com/mikermcneil/test-machinepack-mocha The point of this module is mainly to expose a test runner.
Confused? See http://node-machine.org for documentation.
npm install -g test-machinepack
You can use the generic driver to run tests. To do that, just cd
into your machinepack and then run:
testmachinepack
Tests will be written in JSON or JSON5 format (with .json5 file ending). For each machine you have define you create a JSON file with the same name within a tests
folder. If you install machinepack and run pm scrub
skeleton files will be created for you.
The general format looks like this:
//machine-name.json, or machine-name.json5 if you want comment support
{
//name of the machine as per filename
"machine": "machine-name",
//within expectations you define the tests of your machine
//based on the inputs and exits you have defined
"expectations": [
{
//todo truthy means the test will be skipped
"todo": true,
"using": {
"variable1": ""
},
"outcome": ""
},
{
"using": {
"variable1": "value"
},
"outcome": "error"
},
{
"using": {
"variable": "value1",
"variable2": "value2"
},
"outcome": "error"
}
]
}
So what do real tests look like? Check out this example from machinepack-npm: https://github.com/mikermcneil/machinepack-npm/blob/master/tests/list-packages.json
Want to build a driver for the test framework of your choice? See https://github.com/mikermcneil/test-machinepack-mocha for an example, and check out the files in this repo to see how the driver interface is exposed.
MIT
© 2015-2017 Mike McNeil
FAQs
Raw test runner for machinepacks (also includes a simple stub test driver)
We found that test-machinepack 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.