@@ -31,17 +31,17 @@ export default scenario("Probitas docs site health", {
3131 client . http . createHttpClient ( {
3232 url : BASE_URL ,
3333 } ) )
34- . step ( "serves LLM-friendly markdown at /" , async ( { resources } ) => {
35- const res = await resources . http . get ( "/" , {
34+ . step ( "serves LLM-friendly markdown at /index.md " , async ( { resources } ) => {
35+ const res = await resources . http . get ( "/index.md " , {
3636 headers : { accept : "text/markdown" } ,
3737 } ) ;
3838
3939 expect ( res )
4040 . toBeOk ( )
4141 . toHaveStatus ( 200 )
42- . toHaveHeadersProperty ( "content-type" , / t e x t \ /m a r k d o w n / )
43- . toHaveTextContaining ( / T h i s i s a M a r k d o w n p a g e f o r L L M s \. / )
44- . toHaveTextContaining ( / # P r o b i t a s / ) ;
42+ . toHaveHeadersPropertyContaining ( "content-type" , " text/markdown" )
43+ . toHaveTextContaining ( " This is a Markdown page for LLMs." )
44+ . toHaveTextContaining ( " # Probitas" ) ;
4545 } )
4646 . step ( "serves human homepage HTML" , async ( { resources } ) => {
4747 const res = await resources . http . get ( "/" , {
@@ -52,24 +52,22 @@ export default scenario("Probitas docs site health", {
5252 expect ( res )
5353 . toBeOk ( )
5454 . toHaveStatus ( 200 )
55- . toHaveHeadersProperty ( "content-type" , / t e x t \ /h t m l / )
56- . toHaveTextContaining ( / P r o b i t a s - S c e n a r i o - b a s e d T e s t i n g F r a m e w o r k / )
55+ . toHaveHeadersPropertyContaining ( "content-type" , " text/html" )
56+ . toHaveTextContaining ( " Probitas - Scenario-based Testing Framework" )
5757 . toHaveTextContaining (
58- / S c e n a r i o - b a s e d t e s t i n g f r a m e w o r k d e s i g n e d f o r A P I , d a t a b a s e , a n d m e s s a g e q u e u e t e s t i n g / ,
58+ " Scenario-based testing framework designed for API, database, and message queue testing" ,
5959 )
60- . toHaveTextContaining ( / A I - F r i e n d l y D o c u m e n t a t i o n / ) ;
60+ . toHaveTextContaining ( " AI-Friendly Documentation" ) ;
6161 } )
6262 . step ( "exposes raw markdown for docs pages" , async ( { resources } ) => {
6363 for ( const doc of docPages ) {
64- const res = await resources . http . get ( `${ doc . path } .md` ) ;
64+ const res = await resources . http . get ( `${ doc . path } index .md` ) ;
6565 const heading = docHeadings [ doc . path ] ?? "# " ;
6666 expect ( res )
6767 . toBeOk ( )
6868 . toHaveStatus ( 200 )
69- . toHaveHeadersProperty ( "content-type" , / t e x t \/ m a r k d o w n / )
70- . toHaveTextContaining (
71- new RegExp ( heading . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ) ,
72- ) ;
69+ . toHaveHeadersPropertyContaining ( "content-type" , "text/markdown" )
70+ . toHaveTextContaining ( heading ) ;
7371 }
7472 } )
7573 . step ( "renders docs HTML pages" , async ( { resources } ) => {
@@ -80,57 +78,53 @@ export default scenario("Probitas docs site health", {
8078 expect ( res )
8179 . toBeOk ( )
8280 . toHaveStatus ( 200 )
83- . toHaveHeadersProperty ( "content-type" , / t e x t \/ h t m l / )
84- . toHaveTextContaining (
85- new RegExp ( doc . label . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ) ,
86- ) ;
81+ . toHaveHeadersPropertyContaining ( "content-type" , "text/html" )
82+ . toHaveTextContaining ( doc . label ) ;
8783 }
8884 } )
8985 . step ( "provides LLM endpoints" , async ( { resources } ) => {
9086 const indexRes = await resources . http . get ( "/llms.txt" ) ;
9187 expect ( indexRes )
9288 . toBeOk ( )
9389 . toHaveStatus ( 200 )
94- . toHaveHeadersProperty ( "content-type" , / t e x t \ /m a r k d o w n / )
95- . toHaveTextContaining ( / # # D o c u m e n t a t i o n / )
96- . toHaveTextContaining ( / # # A P I R e f e r e n c e / ) ;
90+ . toHaveHeadersPropertyContaining ( "content-type" , " text/markdown" )
91+ . toHaveTextContaining ( " ## Documentation" )
92+ . toHaveTextContaining ( " ## API Reference" ) ;
9793 } )
9894 . step ( "renders API index and package JSON" , async ( { resources } ) => {
99- const indexRes = await resources . http . get ( "/api" , {
95+ const indexRes = await resources . http . get ( "/api/ " , {
10096 headers : { accept : "text/html" } ,
10197 } ) ;
10298 expect ( indexRes ) . toBeOk ( ) . toHaveStatus ( 200 ) . toHaveTextContaining (
103- / A P I R e f e r e n c e / ,
99+ " API Reference" ,
104100 ) ;
105101
106102 const packages = await getPackageList ( ) ;
107103 for ( const pkg of packages ) {
108- const res = await resources . http . get ( `/api/${ pkg . name } .json` ) ;
104+ const res = await resources . http . get ( `/api/${ pkg . name } /index .json` ) ;
109105 expect ( res )
110106 . toBeOk ( )
111107 . toHaveStatus ( 200 )
112- . toHaveHeadersProperty ( "content-type" , / a p p l i c a t i o n \ /j s o n / )
108+ . toHaveHeadersPropertyContaining ( "content-type" , " application/json" )
113109 . toHaveDataMatching ( { name : pkg . name , specifier : pkg . specifier } ) ;
114110 }
115111 } )
116112 . step ( "renders API markdown endpoints" , async ( { resources } ) => {
117113 const packages = await getPackageList ( ) ;
118114 for ( const pkg of packages ) {
119- const res = await resources . http . get ( `/api/${ pkg . name } .md` ) ;
115+ const res = await resources . http . get ( `/api/${ pkg . name } /index .md` ) ;
120116 expect ( res )
121117 . toBeOk ( )
122118 . toHaveStatus ( 200 )
123- . toHaveHeadersProperty ( "content-type" , / t e x t \/ m a r k d o w n / )
124- . toHaveTextContaining (
125- new RegExp ( pkg . specifier . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ) ,
126- ) ;
119+ . toHaveHeadersPropertyContaining ( "content-type" , "text/markdown" )
120+ . toHaveTextContaining ( pkg . specifier ) ;
127121 }
128122 } )
129123 . step ( "serves static assets" , async ( { resources } ) => {
130124 const res = await resources . http . get ( "/static/style.css" ) ;
131- expect ( res ) . toBeOk ( ) . toHaveStatus ( 200 ) . toHaveHeadersProperty (
125+ expect ( res ) . toBeOk ( ) . toHaveStatus ( 200 ) . toHaveHeadersPropertyContaining (
132126 "content-type" ,
133- / t e x t \ /c s s / ,
127+ " text/css" ,
134128 ) ;
135129 } )
136130 . build ( ) ;
0 commit comments