diff --git a/src/rules/expectRule.ts b/src/rules/expectRule.ts index c79cf2c..b238dd1 100644 --- a/src/rules/expectRule.ts +++ b/src/rules/expectRule.ts @@ -371,7 +371,7 @@ function getExpectTypeFailures( ? checker.typeToString(type, /*enclosingDeclaration*/ undefined, ts.TypeFormatFlags.NoTruncation) : ""; - if (actual !== expected && !matchReadonlyArray(actual, expected)) { + if (!expected.split(/\s*\|\|\s*/).some(s => actual === s || matchReadonlyArray(actual, s))) { unmetExpectations.push({ node, expected, actual }); }