import Prism from 'prismjs'; import promql from './promql'; describe('Loki syntax', () => { it('should highlight Loki query correctly', () => { expect(Prism.highlight('{key="val#ue"}', promql, 'promql')).toBe( '{key="val#ue"}' ); expect(Prism.highlight('{key="#value"}', promql, 'promql')).toBe( '{key="#value"}' ); expect(Prism.highlight('{key="value#"}', promql, 'promql')).toBe( '{key="value#"}' ); expect(Prism.highlight('#test{key="value"}', promql, 'promql')).toBe( '#test{key="value"}' ); expect(Prism.highlight('{key="value"}#test', promql, 'promql')).toBe( '{key="value"}#test' ); }); });