openpencil/tests/engine/app/code/highlight.test.ts
Danila Poyarkov 8f35746060 fix(app): keep desktop startup console clean
- Load Prism JSX only after exposing the Prism runtime

- Treat unavailable MCP automation as optional during startup

- Connect the desktop automation bridge only after MCP is ready
2026-08-11 13:56:04 +03:00

16 lines
655 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { highlightJSX } from '@/app/code/highlight'
describe('code highlighting', () => {
test('highlights JavaScript and JSX syntax without a Prism global', () => {
const existingPrism = Reflect.get(globalThis, 'Prism')
const html = highlightJSX('const view = <Button disabled>{label}</Button>')
expect(html).toContain('<span class="token keyword">const</span>')
expect(html).toContain('<span class="token class-name">Button</span>')
expect(html).toContain('<span class="token attr-name">disabled</span>')
expect(Reflect.get(globalThis, 'Prism')).toBe(existingPrism)
})
})