paritytech / zombienet

A cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
https://paritytech.github.io/zombienet/
GNU General Public License v3.0
162 stars 91 forks source link

add support to pass a json as arg for `js-script` #1902

Closed pepoviola closed 1 month ago

pepoviola commented 1 month ago

Add support for passing a json as arg to js-script. Should be single quoted json like:

alice: js-script ./0001-custom-json.js with '{"account": "alice", "nums": [0,1,2,3], "bool": true}' within 200 seconds

And in the script you have access to the Object directly

async function run(nodeName, networkInfo, argObject) {
    if (argObject.account != "alice") {
        console.log("JSON err: field name");
    }

cc: @bkontur