File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ def routes[F[_]: Files: MonadThrow](
204204 Router (spaRoute -> r)
205205
206206 val refreshRoutes = HttpRoutes .of[IO ] {
207- case GET -> Root / " api " / " v1" / " sse" =>
207+ case GET -> Root / " refresh " / " v1" / " sse" =>
208208 val keepAlive = fs2.Stream .fixedRate[IO ](10 .seconds).as(KeepAlive ())
209209 Ok (
210210 keepAlive
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ import org.http4s.Method
1818import org .http4s .Uri
1919import scalatags .Text .styles
2020
21+ import scala .concurrent .duration .*
22+
2123/*
2224Run
2325cs launch com.microsoft.playwright:playwright:1.41.1 -M "com.microsoft.playwright.CLI" -- install --with-deps
@@ -130,13 +132,13 @@ trait PlaywrightTest extends CatsEffectSuite:
130132 )
131133 LiveServer .main(lsc).map((_, dir, lsc.port))
132134 }
133- }.test(" incremental" ) {
135+ }.test(" incremental" .only ) {
134136 (_, testDir, port) =>
135137 val increaseTimeout = ContainsTextOptions ()
136138 increaseTimeout.setTimeout(15000 )
137-
138- IO (page.navigate(s " http://localhost: $port" )) >>
139- IO (assertThat(page.locator(" h1" )).containsText(" HelloWorld" , increaseTimeout)) >>
139+ IO .sleep( 3 .seconds) >>
140+ IO (page.navigate(s " http://localhost: $port" )) >>
141+ IO (assertThat(page.locator(" h1" )).containsText(" HelloWorld" , increaseTimeout)) >>
140142 IO .blocking(os.write.over(testDir / " hello.scala" , helloWorldCode(" Bye" ))) >>
141143 IO (assertThat(page.locator(" h1" )).containsText(" ByeWorld" , increaseTimeout)) >>
142144 IO .blocking(os.write.append(styleDir(testDir) / " index.less" , " h1 { color: red; }" )) >>
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ You'll need to make sure it includes this script. Otherwise no reload on change.
147147
148148``` html
149149 <script >
150- const sse = new EventSource (" /api /v1/sse" );
150+ const sse = new EventSource (" /refresh /v1/sse" );
151151 sse .addEventListener (" message" , (e ) => {
152152 const msg = JSON .parse (e .data );
153153
You can’t perform that action at this time.
0 commit comments