File tree 2 files changed +9
-15
lines changed
2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -477,6 +477,9 @@ function Start-Htmx {
477
477
)
478
478
}
479
479
480
+ $null = Register-EngineEvent - SourceIdentifier PowerShell.Exiting - Action {
481
+ Get-Job | ? HttpListener | Stop-Htmx
482
+ }
480
483
while ($serverJob.JobStateInfo.State -eq ' NotStarted' ) {
481
484
Start-Sleep - Milliseconds (Get-Random - Maximum 20 - Minimum 1 )
482
485
}
Original file line number Diff line number Diff line change @@ -12,21 +12,12 @@ describe HtmxPS {
12
12
}
13
13
14
14
context ' Start-Htmx and Stop-Htmx' {
15
- it " Will start and stop a small htmx server" {
16
- if (-not $env: GITHUB_WORKSPACE ) {
17
- $startedLocalJob = Start-Htmx - Htmx (
18
- htmx button " Click Me" hx- on:click= " alert('Thanks, I needed that!')"
19
- )
20
- Invoke-RestMethod - Uri $startedLocalJob.ServerUrl
21
- $startedLocalJob | Stop-Htmx - PassThru | Remove-Job
22
- } else {
23
- $startedLocalJob = Start-Htmx - Htmx (
24
- htmx button " Click Me" hx- on:click= " alert('Thanks, I needed that!')"
25
- ) - ServerUrl " http://127.0.0.1:8080/"
26
- # Start-Sleep -Seconds 1
27
- Invoke-RestMethod - Uri $startedLocalJob.ServerUrl
28
- $startedLocalJob | Stop-Htmx - PassThru | Remove-Job
29
- }
15
+ it " Will start and stop a small htmx server" {
16
+ $startedLocalJob = Start-Htmx - Htmx (
17
+ htmx button " Click Me" hx- on:click= " alert('Thanks, I needed that!')"
18
+ )
19
+ Invoke-RestMethod - Uri $startedLocalJob.ServerUrl
20
+ $startedLocalJob | Stop-Htmx - PassThru | Remove-Job
30
21
}
31
22
}
32
23
}
You can’t perform that action at this time.
0 commit comments