should replaced with chai + optimized error messages