Skip to content

Commit 135959c

Browse files
committed
verify that vaild input doesn't have validation or lexer errors
1 parent 955f77f commit 135959c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parsing/ParsingTestHelper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export async function parseValidInput (parse: ReturnType<typeof parseHelper<Cont
77
const document = await parse(input)
88

99
expectNoParsingErrors(document)
10+
expect(document.parseResult.lexerErrors).toHaveLength(0)
11+
expect(document.diagnostics || []).toHaveLength(0)
12+
1013
return document
1114
}
1215

@@ -17,5 +20,5 @@ export async function parseInvalidInput (parse: ReturnType<typeof parseHelper<Co
1720
}
1821

1922
export function expectNoParsingErrors (document: LangiumDocument<ContextMappingModel>) {
20-
expect(document.parseResult.parserErrors.length).toEqual(0)
23+
expect(document.parseResult.parserErrors).toHaveLength(0)
2124
}

0 commit comments

Comments
 (0)