The message now also reports the name of the predicate function that failed. PR Close #38959 PR Close #39272
This commit is contained in:
parent
df0941554b
commit
db34b23ab5
@ -60,7 +60,8 @@ export function getDeclaration<T extends ts.Declaration>(
|
|||||||
throw new Error(`No such symbol: ${name} in ${fileName}`);
|
throw new Error(`No such symbol: ${name} in ${fileName}`);
|
||||||
}
|
}
|
||||||
if (!assert(chosenDecl)) {
|
if (!assert(chosenDecl)) {
|
||||||
throw new Error(`Symbol ${name} from ${fileName} is a ${ts.SyntaxKind[chosenDecl.kind]}`);
|
throw new Error(`Symbol ${name} from ${fileName} is a ${
|
||||||
|
ts.SyntaxKind[chosenDecl.kind]}. Expected it to pass predicate "${assert.name}()".`);
|
||||||
}
|
}
|
||||||
return chosenDecl;
|
return chosenDecl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user