-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest
More file actions
executable file
·37 lines (27 loc) · 697 Bytes
/
test
File metadata and controls
executable file
·37 lines (27 loc) · 697 Bytes
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 bash
set -e
setUpBeforeTestSuite() {
export GIT_PRETTY_PR_TEST="true"
export TESTED_BRANCH=$(git rev-parse --abbrev-ref HEAD)
testDir=/tmp/git-pretty-pull-request/
[ -e $testDir ] && rm -rf $testDir
cp -r $suiteDir $testDir
cd $testDir
git config pretty-pull-request.pull-bases "preprod prod"
setup_mocks
}
tearDownAfterTestSuite() {
rm -rf $testDir
}
setup_mocks() {
for mock in $suiteDir/tests/mocks/*.sh; do
. $mock
done
}
suiteDir=$(cd $(dirname $0) && pwd)
#########################################
# Main
#########################################
setUpBeforeTestSuite
bats $suiteDir/tests
tearDownAfterTestSuite