Fixed testing: npm test builds, tests and returns code as expected

Not sure if the cleanest way to implement, but now failing test returns non-zero exit code.