mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-21 01:06:43 +02:00
added parser
This commit is contained in:
@@ -8,11 +8,23 @@ describe('gitGraph', () => {
|
||||
const result = parse(`gitGraph`);
|
||||
expect(result.value.$type).toBe(GitGraph);
|
||||
expect(result.value.statements).toHaveLength(0);
|
||||
expect(result.lexerErrors).toHaveLength(0);
|
||||
expect(result.parserErrors).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should handle gitGraph with one statement', () => {
|
||||
const result = parse(`gitGraph\n A`);
|
||||
const result = parse(`gitGraph\n commit\n`);
|
||||
expect(result.value.$type).toBe(GitGraph);
|
||||
expect(result.lexerErrors).toHaveLength(0);
|
||||
expect(result.parserErrors).toHaveLength(0);
|
||||
expect(result.value.statements).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should handle gitGraph with multiple statements and use accTitle', () => {
|
||||
const result = parse(`gitGraph\n commit\n commit\n accTitle: title\n commit\n`);
|
||||
expect(result.value.$type).toBe(GitGraph);
|
||||
expect(result.lexerErrors).toHaveLength(0);
|
||||
expect(result.parserErrors).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user