Function toHaveNoIssues

  • Expects a Langium document to have no issues after parsing.

    Parameters

    • document: LangiumDocument<AstNode> | ParsedDocument

      The Langium document or parsed document to check for issues.

    • Optionalparameters: IgnoreParameters

      Optional parameters to customize which issues to ignore.

    Returns { message: () => string; pass: boolean }

    import { expect, test } from 'vitest';
    import { parse } from './your-langium-test-setup';

    test('document has no issues', async () => {
    const doc = await parse('const x = 5;');
    expect(doc).toHaveNoIssues();
    });

    test('document has no issues, ignoring lexer errors', async () => {
    const doc = await parse('const x = @;', { validation: true });
    expect(doc).toHaveNoIssues({ ignoreLexerErrors: true });
    });