make ErrorMatcher an object rather than a tuple

This commit is contained in:
Nick Fyson
2020-09-11 18:30:07 +01:00
parent 1fb7c81099
commit b3b99014eb
12 changed files with 58 additions and 48 deletions

View File

@@ -20,8 +20,8 @@ function testErrorMatcher(matcherName, logSample) {
if (!(matcherName in error_matcher_1.namedMatchersForTesting)) {
throw new Error(`Unknown matcher ${matcherName}`);
}
const regex = error_matcher_1.namedMatchersForTesting[matcherName][1];
if (regex === null) {
const regex = error_matcher_1.namedMatchersForTesting[matcherName].outputRegex;
if (regex === undefined) {
throw new Error(`Cannot test matcher ${matcherName} with null regex`);
}
return regex.test(logSample);