Skip to content

Commit 0f06217

Browse files
author
James Brundage
committed
fix: Start-Htmx ( Fixes #7 )
Skipping Start/Stop test in a workflow
1 parent 05bc5f1 commit 0f06217

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

HtmxPS.tests.ps1

+10-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ describe HtmxPS {
1313

1414
context 'Start-Htmx and Stop-Htmx' {
1515
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
21-
$startedLocalJob | Remove-Job
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
22+
$startedLocalJob | Remove-Job
23+
} else {
24+
"This test cannot be run in a GitHub workflow without a service container."
25+
}
2226
}
2327
}
2428
}

0 commit comments

Comments
 (0)