-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Would actually like to error on all errors, but `Enable-ExperimentalFeature` | ||
# does not work for this version of Windows | ||
# https://github.com/PowerShell/PowerShell/issues/3415#issuecomment-1354457563 | ||
Set-StrictMode -Version Latest | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Add cargo to PATH | ||
$env:Path += [IO.Path]::PathSeparator + "$env:USERPROFILE/.cargo/bin" | ||
|
||
# Start locally | ||
$job = Start-Job -Name "local-run" -ScriptBlock { cd examples/rocket/postgres; cargo shuttle run } | ||
Start-Sleep -Seconds 300 | ||
|
||
echo "Testing local wasm endpoint" | ||
$postParams = @{note='test'} | ||
$output=curl http://localhost:8000/todo -Method Post -Body $postParams | Select-Object -ExpandProperty Content | ||
if ( $output -ne '{"id":1,"note":"test"}') | ||
{ | ||
echo "Did not expect POST output: $output" | ||
exit 1 | ||
} | ||
|
||
$output=curl http://localhost:8000/todo/1 | Select-Object -ExpandProperty Content | ||
if ( $output -ne '{"id":1,"note":"test"}') | ||
{ | ||
echo "Did not expect output: $output" | ||
exit 1 | ||
} | ||
|
||
Stop-Job $job | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters