@@ -40,8 +40,27 @@ export const describe = baseDescribe
4040// Re-export expect from vitest
4141export { expect }
4242
43+ // Fluent interface for any corpus type (HAR or HTML)
44+ export function withCorpus ( corpusKey : keyof typeof CORPUS ) {
45+ return {
46+ it : ( name : string , fn : ( ) => void | Promise < void > ) => {
47+ return baseTest ( `${ String ( corpusKey ) } :${ name } ` , async ( ) => {
48+ // Setup DOM for any corpus type (delegates to HAR or HTML based on type)
49+ await setupDOM ( corpusKey )
50+
51+ try {
52+ return await fn ( )
53+ } finally {
54+ // Cleanup after test
55+ cleanupDOM ( )
56+ }
57+ } )
58+ } ,
59+ }
60+ }
61+
4362// Helper function for detection tests
44- export function getDetectionResults ( ) {
63+ export function detectedSpots ( ) {
4564 const enhancers = new EnhancerRegistry ( )
4665 const textareas = document . querySelectorAll ( 'textarea' )
4766 const location : StrippedLocation = {
@@ -61,7 +80,7 @@ export function getDetectionResults() {
6180}
6281
6382// Helper function for UI tests
64- export function getUIResults ( ) {
83+ export function tableUI ( ) {
6584 const enhancers = new EnhancerRegistry ( )
6685 const textareas = document . querySelectorAll ( 'textarea' )
6786 const location : StrippedLocation = {
@@ -88,22 +107,3 @@ export function getUIResults() {
88107 }
89108 return uiResults
90109}
91-
92- // Fluent interface for any corpus type (HAR or HTML)
93- export function withCorpus ( corpusKey : keyof typeof CORPUS ) {
94- return {
95- it : ( name : string , fn : ( ) => void | Promise < void > ) => {
96- return baseTest ( `${ String ( corpusKey ) } :${ name } ` , async ( ) => {
97- // Setup DOM for any corpus type (delegates to HAR or HTML based on type)
98- await setupDOM ( corpusKey )
99-
100- try {
101- return await fn ( )
102- } finally {
103- // Cleanup after test
104- cleanupDOM ( )
105- }
106- } )
107- } ,
108- }
109- }
0 commit comments