test: improve common.expectsError
The output is now improved by showing most properties all at once.
Besides that this adds a warning to use assert.throws
instead
due to a better output.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines