11import { render , waitFor } from '@testing-library/react' ;
22import { vi } from 'vitest' ;
3- import { useShikiHighlighter , createJavaScriptRegexEngine } from '../src/index' ;
3+ import {
4+ useShikiHighlighter ,
5+ createJavaScriptRegexEngine ,
6+ } from '../src/index' ;
47import type { Language , Theme , Themes } from '../src/lib/types' ;
58import type { ShikiTransformer } from 'shiki' ;
69import { throttleHighlighting } from '../src/lib/utils' ;
@@ -372,7 +375,9 @@ describe('useShikiHighlighter Hook', () => {
372375 const container = getByTestId ( 'highlighted' ) ;
373376 const pre = container . querySelector ( 'pre' ) ;
374377 // Should have multi-theme CSS variables
375- const spans = container . querySelectorAll ( 'span[style*="--shiki-"]' ) ;
378+ const spans = container . querySelectorAll (
379+ 'span[style*="--shiki-"]'
380+ ) ;
376381 expect ( spans . length ) . toBeGreaterThan ( 0 ) ;
377382 expect ( pre ) . toBeInTheDocument ( ) ;
378383 } ) ;
@@ -520,12 +525,12 @@ describe('useShikiHighlighter Hook', () => {
520525 // Verify HTML string contains syntax highlighting elements
521526 expect ( capturedOutput ) . toContain ( 'style=' ) ;
522527 expect ( capturedOutput ) . toContain ( 'color:' ) ;
523-
528+
524529 // Verify rendered DOM has highlighted spans
525530 const container = getByTestId ( 'output' ) ;
526531 const spans = container . querySelectorAll ( 'span[style*="color"]' ) ;
527532 expect ( spans . length ) . toBeGreaterThan ( 0 ) ;
528-
533+
529534 // Verify the code content is preserved
530535 expect ( container . textContent ) . toContain ( 'const x = 1;' ) ;
531536 } ) ;
@@ -540,7 +545,7 @@ describe('useShikiHighlighter Hook', () => {
540545 'javascript' ,
541546 'github-dark' ,
542547 {
543- engine : createJavaScriptRegexEngine ( )
548+ engine : createJavaScriptRegexEngine ( ) ,
544549 }
545550 ) ;
546551
0 commit comments