forked from gigalixir/gigalixir-buildpack-phoenix-static
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolve_node_versions_test.sh
More file actions
executable file
·83 lines (46 loc) · 1.32 KB
/
resolve_node_versions_test.sh
File metadata and controls
executable file
·83 lines (46 loc) · 1.32 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source $SCRIPT_DIR/.test_support.sh
# include source file
source $SCRIPT_DIR/../lib/build.sh
# override functions used
fail_bin_install() {
failed=true
}
# TESTS
######################
suite "resolve_node_versions"
test "node version specified with 'vX.Y.Z' format"
node_version=v20.8.1
resolve_node_version > /dev/null
[ "20.8.1" == "$node_version" ]
[ ! -z "$node_url" ]
[ ! -z "$node_sha" ]
[ ! -z "$cached_node" ]
[ ! -z "$cached_sha" ]
[ -e $cached_sha ]
! $failed
test "unknown node version specified"
node_version=v0.0.0
resolve_node_version > /dev/null
$failed
test "node version specified with 'X.Y.Z' format"
node_version=20.8.1
resolve_node_version > /dev/null
[ "20.8.1" == "$node_version" ]
! $failed
test "node version specified with 'latest' string"
node_version=latest
resolve_node_version > /dev/null
[ ! -z "$node_version" ]
[ "latest" != "$node_version" ]
! $failed
LATEST=$node_version
test "node version specified with empty string"
node_version=""
resolve_node_version > /dev/null
[ ! -z "$node_version" ]
[ "$LATEST" == "$node_version" ]
! $failed
PASSED_ALL_TESTS=true