import Prism from 'prismjs'; import { tokenizer } from './syntax'; describe('Loki syntax', () => { it('should highlight Loki query correctly', () => { expect(Prism.highlight('key=value', tokenizer, 'tempo')).toBe( 'key=value' ); expect(Prism.highlight('root.ip=172.123.0.1', tokenizer, 'tempo')).toBe( 'root.ip=172.123.0.1' ); expect(Prism.highlight('root.name="http get /config"', tokenizer, 'tempo')).toBe( 'root.name="http get /config"' ); expect(Prism.highlight('key=value key2=value2', tokenizer, 'tempo')).toBe( 'key=value key2=value2' ); }); });