Needed to use when/node/function not when/callback; that revealed actual issues with the code and now the first test passes.