How to use customized validator in unit tests for document-validator? #1933
-
Hi Langium team, I am trying to implement unit tests for all the error messages in my project. let services: ReturnType<typeof createMyServices>;
let document: LangiumDocument<Model> | undefined;
let documentValidator: MyDocumentValidator;
let documentValidatorAny: any;
let parse: ReturnType<typeof parseHelper<Model>>;
beforeAll(async () => {
services = createMyServices(EmptyFileSystem);
parse = parseHelper<Model>(services.MyService);
documentValidator = new MyDocumentValidator(services.MyService);
documentValidatorAny = documentValidator as any;
}); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
@durianwaffle i cannot follow you. where do you validate? i dont see any refeences to |
Beta Was this translation helpful? Give feedback.
-
Hey @durianwaffle, just as Christian, I would recommend you to use the |
Beta Was this translation helpful? Give feedback.
I mean, it's just a recommendation. You don't absolutely need to use it.