Skip to content
CCPEDIAby Unity Nodes
App Development

Jest/Puppeteer Test Suite failing to run on example

3 posts488 viewsLast activity Jul 2022

  1. mprohorov1OP

    Hello, I’ve been looking to run the example test suite posted in https://docs.daml.com/getting-started/testing.html with the template create-daml-app.

    After following the steps and running npm test, Console throws some errors:

    Ex: Party names are unique
    thrown: “Exceeded timeout of 60000 ms for a hook”

    for all written tests, and afterward

    Test suite failed to run
    spawn npm-cli.js ENOENT
    Test suite failed to run
    TypeError: The “pid” argument must be of type number. Received type number (NaN)

    The last statement in console.debug before failing is “Starting npm start”, so I suspect it’s something to do with spawning the npm start process in beforeAll(). Not sure how to go about troubleshooting this, so any help is appreciated!

    Running on Ubuntu 20.04 LTS.

  2. Gary_Verhaegen

    Hi @mprohorov1,

    I’m not very familiar with this part; would you mind sharing a bit more details about exactly what you’ve done, and maybe a bit more of the console output, preferably within triple-backticks?

  3. mprohorov1

    Hey @Gary_Verhaegen ,

    I ended up finding the point of failure and resolving this. In the beforeAll() function:

    uiProc = spawn("npm-cli.js", ["run-script", "start"], {
       env,
       stdio:"inherit",
       detached: true,
    });
    

    changed to

    uiProc = spawn("npm", ["run-script", "start"], {
       env,
       stdio:"inherit",
       detached: true,
    });
    

    So, it’s likely just a mismatched name in the PATH.