fix(tests): correctly return the exit code

Fix regression introduced in #2869.

It is expected that the build will now fail.