Skip to content
Snippets Groups Projects
Commit db34b23a authored by Pete Bacon Darwin's avatar Pete Bacon Darwin Committed by atscott
Browse files

test(compiler-cli): improve error message if a unit test is bad (#38959) (#39272)

The message now also reports the name of the predicate function
that failed.

PR Close #38959

PR Close #39272
parent df094155
No related merge requests found
......@@ -60,7 +60,8 @@ export function getDeclaration<T extends ts.Declaration>(
throw new Error(`No such symbol: ${name} in ${fileName}`);
}
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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment