mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
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(
|
|
'<span class="token key attr-name">key</span><span class="token operator">=</span><span class="token value">value</span>'
|
|
);
|
|
expect(Prism.highlight('root.ip=172.123.0.1', tokenizer, 'tempo')).toBe(
|
|
'<span class="token key attr-name">root.ip</span><span class="token operator">=</span><span class="token value">172.123.0.1</span>'
|
|
);
|
|
expect(Prism.highlight('root.name="http get /config"', tokenizer, 'tempo')).toBe(
|
|
'<span class="token key attr-name">root.name</span><span class="token operator">=</span><span class="token value">"http get /config"</span>'
|
|
);
|
|
expect(Prism.highlight('key=value key2=value2', tokenizer, 'tempo')).toBe(
|
|
'<span class="token key attr-name">key</span><span class="token operator">=</span><span class="token value">value</span> <span class="token key attr-name">key2</span><span class="token operator">=</span><span class="token value">value2</span>'
|
|
);
|
|
});
|
|
});
|