-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathdev_setup.test.bats
89 lines (66 loc) · 1.36 KB
/
dev_setup.test.bats
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
84
85
86
87
88
89
#!/usr/bin/env bats
@test "homebrew is installed" {
mac_only
run found_exe brew
[ "$status" -eq 0 ]
}
@test "watchman is installed" {
mac_only
run found_exe watchman
[ "$status" -eq 0 ]
}
@test "yarn is installed" {
run found_exe yarn
[ "$status" -eq 0 ]
}
@test "react-native is installed" {
run found_exe react-native
[ "$status" -eq 0 ]
}
@test "node is installed" {
run found_exe node
[ "$status" -eq 0 ]
}
@test "java is installed" {
run found_exe java
[ "$status" -eq 0 ]
}
@test "android-studio is installed" {
linux_only
run found_exe android-studio
[ "$status" -eq 0 ]
}
@test "~/.profile_mobileapp exists" {
run test -f $HOME/.profile_mobileapp
[ "$status" -eq 0 ]
}
@test "ios/vendor/bundle exists" {
mac_only
run test -d ios/vendor/bundle
[ "$status" -eq 0 ]
}
@test "ANDROID_SDK_ROOT is set (Mac)" {
mac_only
source ~/.profile_mobileapp
run echo "$ANDROID_SDK_ROOT"
[ "$output" == "$HOME/Library/Android/sdk" ]
}
@test "ANDROID_SDK_ROOT is set (Linux)" {
linux_only
source ~/.profile_mobileapp
run echo "$ANDROID_SDK_ROOT"
[ "$output" == "$HOME/Android/Sdk" ]
}
function found_exe() {
hash "$1" 2>/dev/null
}
function linux_only() {
if [ "$OSTYPE" != "linux"* ]; then
skip "Linux only test"
fi
}
function mac_only() {
if [ "$OSTYPE" != "darwin"* ]; then
skip "Mac only test"
fi
}