fix(test): result is not defined on error