Skip to content

Commit e52a9e5

Browse files
bnbMarshallOfSound
authored andcommitted
fix: improve provided context in key token error (#22)
* fix: improve provided context in key token error * fix: run `tsc`
1 parent b08d4f9 commit e52a9e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/markdown-helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,10 @@ const convertNestedListToTypedKeys = (list: List): TypedKey[] => {
669669
'Expected token token to have at least 1 child for typed key extraction',
670670
);
671671
const keyToken = targetToken.children[0];
672-
expect(keyToken.type).to.equal('code_inline', 'Expected key token to be an inline code block');
672+
expect(keyToken.type).to.equal(
673+
'code_inline',
674+
`Expected key token to be an inline code block but instead encountered "${keyToken.content}"`,
675+
);
673676
const typeAndDescriptionTokens = targetToken.children.slice(1);
674677
const joinedContent = safelyJoinTokens(typeAndDescriptionTokens);
675678

0 commit comments

Comments
 (0)