mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-10-25 00:44:10 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
		
			889 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			889 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { describe, expect, it } from 'vitest';
 | |
| 
 | |
| import { Info } from '../src/language/index.js';
 | |
| import { expectNoErrorsOrAlternatives, infoParse as parse } from './test-util.js';
 | |
| 
 | |
| describe('info', () => {
 | |
|   it.each([
 | |
|     `info`,
 | |
|     `
 | |
|     info`,
 | |
|     `info
 | |
|     `,
 | |
|     `
 | |
|     info
 | |
|     `,
 | |
|   ])('should handle empty info', (context: string) => {
 | |
|     const result = parse(context);
 | |
|     expectNoErrorsOrAlternatives(result);
 | |
|     expect(result.value.$type).toBe(Info);
 | |
|   });
 | |
| 
 | |
|   it.each([
 | |
|     `info showInfo`,
 | |
|     `info showInfo
 | |
|     `,
 | |
|     `
 | |
|     info showInfo`,
 | |
|     `info
 | |
|     showInfo`,
 | |
|     `info
 | |
|     showInfo
 | |
|     `,
 | |
|     `
 | |
|     info
 | |
|     showInfo
 | |
|     `,
 | |
|     `
 | |
|     info
 | |
|     showInfo`,
 | |
|     `
 | |
|     info showInfo
 | |
|     `,
 | |
|   ])('should handle showInfo', (context: string) => {
 | |
|     const result = parse(context);
 | |
|     expectNoErrorsOrAlternatives(result);
 | |
|     expect(result.value.$type).toBe(Info);
 | |
|   });
 | |
| });
 | 
