mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-20 20:54:27 +01:00
fix(#4140): Remove direct usage of mermaidAPI.render
This commit is contained in:
@@ -15,13 +15,17 @@ describe('DiagramAPI', () => {
|
||||
});
|
||||
|
||||
it('should throw error if diagram is not defined', () => {
|
||||
expect(() => getDiagram('loki')).toThrow();
|
||||
expect(() => getDiagram('loki')).toThrowErrorMatchingInlineSnapshot(
|
||||
'"Diagram loki not found."'
|
||||
);
|
||||
});
|
||||
|
||||
it('should handle diagram registrations', () => {
|
||||
expect(() => getDiagram('loki')).toThrow();
|
||||
expect(() => detectType('loki diagram')).toThrow(
|
||||
'No diagram type detected for text: loki diagram'
|
||||
expect(() => getDiagram('loki')).toThrowErrorMatchingInlineSnapshot(
|
||||
'"Diagram loki not found."'
|
||||
);
|
||||
expect(() => detectType('loki diagram')).toThrowErrorMatchingInlineSnapshot(
|
||||
'"No diagram type detected for text: loki diagram"'
|
||||
);
|
||||
const detector: DiagramDetector = (str: string) => {
|
||||
return str.match('loki') !== null;
|
||||
|
||||
Reference in New Issue
Block a user