move error matcher definition into dedicated file

This commit is contained in:
Nick Fyson 2020-09-07 15:49:03 +01:00
parent 1f3ce75844
commit 7dbaff09b6
11 changed files with 40 additions and 12 deletions

2
lib/exec_wrapper.js generated
View file

@ -64,7 +64,7 @@ async function exec_wrapper(commandLine, args, matchers, options) {
return returnState;
if (matchers) {
for (const [customCode, regex, message] of matchers) {
if (customCode === returnState || regex.test(stderr) || regex.test(stdout)) {
if (customCode === returnState || regex && (regex.test(stderr) || regex.test(stdout))) {
throw new Error(message);
}
}