-
Notifications
You must be signed in to change notification settings - Fork 180
/
install_test.ps1
executable file
·36 lines (31 loc) · 1.15 KB
/
install_test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env pwsh
$ErrorActionPreference = 'Stop'
# Test that we can install the latest version at the default location.
Remove-Item "~\.deno" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = ""
$v = $null; .\install.ps1
~\.deno\bin\deno.exe --version
# Test that we can install a specific version at a custom location.
Remove-Item "~\deno-1.0.0" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = "$Home\deno-1.0.0"
$v = "1.0.0"; .\install.ps1
$DenoVersion = ~\deno-1.0.0\bin\deno.exe --version
if (!($DenoVersion -like '*1.0.0*')) {
throw $DenoVersion
}
# Test that we can install at a relative custom location.
Remove-Item "bin" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = "."
$v = "1.1.0"; .\install.ps1
$DenoVersion = bin\deno.exe --version
if (!($DenoVersion -like '*1.1.0*')) {
throw $DenoVersion
}
# Test that the old temp file installer still works.
Remove-Item "~\deno-1.0.1" -Recurse -Force -ErrorAction SilentlyContinue
$env:DENO_INSTALL = "$Home\deno-1.0.1"
$v = $null; .\install.ps1 v1.0.1
$DenoVersion = ~\deno-1.0.1\bin\deno.exe --version
if (!($DenoVersion -like '*1.0.1*')) {
throw $DenoVersion
}