Skip to content

Commit c8f2aaa

Browse files
author
James Brundage
committed
feat: Start-Htmx ( Fixes #7 )
Refactoring test to try to run in workflow
1 parent 21f39f0 commit c8f2aaa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

HtmxPS.tests.ps1

+10-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ describe HtmxPS {
2020
Invoke-RestMethod -Uri $startedLocalJob.ServerUrl
2121
$startedLocalJob | Stop-Htmx
2222
$startedLocalJob | Remove-Job
23-
} else {
24-
"This test cannot be run in a GitHub workflow without a service container."
25-
}
23+
} elseif ($env:HOSTNAME) {
24+
$startedLocalJob = Start-Htmx -Htmx (
25+
htmx button "Click Me" hx-on:click="alert('Thanks, I needed that!')"
26+
) -ServerUrl "http://$env:HOSTNAME:$(Get-Random -Min 4kb -Max 32kb)"
27+
Invoke-RestMethod -Uri $startedLocalJob.ServerUrl
28+
$startedLocalJob | Stop-Htmx
29+
$startedLocalJob | Remove-Job
30+
} else {
31+
"This test cannot be run without a GitHub workflow that has a host name."
32+
}
2633
}
2734
}
2835
}

0 commit comments

Comments
 (0)