npm test fails with "TypeError: fn is not a function" while running mocha test in Jenkins

First, which course and which lab is this Jenkins pipeline running in? A link would help a lot – not enough context from that error stack to tell us why the error was thrown. Knowing what I do about the solar-system application, I’d guess that the environment variables needed by the nodejs program are wrong, and that’s the source of the error. So knowing what’s in the Jenkinsfile will help me figure out what’s getting passed to the program and to the test.