Propagate return code in test.js, fixed #2