Github PR reviews will be formatted much better. Inline with mermaid project.
20 lines
444 B
TypeScript
20 lines
444 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { detectType } from './stats';
|
|
describe('diagram detection', () => {
|
|
it('should detect diagrams correctly', () => {
|
|
expect(
|
|
detectType(`%%{{
|
|
graph`)
|
|
).toBe('graph');
|
|
expect(detectType(`gitGraph`)).toBe('gitGraph');
|
|
expect(
|
|
detectType(`%%{{
|
|
|
|
|
|
flowChart
|
|
graph`)
|
|
).toBe('flowChart');
|
|
expect(detectType(`loki -> thor`)).toBe(undefined);
|
|
});
|
|
});
|