Skip to content
Discussion options

You must be logged in to vote

Here I come to my last open problem: In the very last test, the cross-reference in Hello Peter! fails, since person Peter has not been declared. How do express this expectation in the test?

You can access the reference to the person on the Hello object and confirm that the error property is set, or that the ref property is undefined.

Ok, thanks! The following code works for me:

test('Wrong Reference', async () => {
    const validation = await validate(`
     person Anna 
     Hello Peter!
    `);
    const greeting = (validation.document.parseResult.value.greetings[0] as Greeting);
    // reference starting at greeting object is not defined and has error-property
    expect(greeting.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@thomasbaar
Comment options

@msujew
Comment options

@thomasbaar
Comment options

Answer selected by thomasbaar
@msujew
Comment options

@thomasbaar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants