-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
32 lines (32 loc) · 984 Bytes
/
.travis.yml
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
dist: trusty
language: node_js
node_js:
- '12'
addons:
# Installing dpkg to fix Chrome install errors
apt:
packages:
- dpkg
chrome: stable
before_script:
- java -jar tests/ui/selenium-server-standalone-3.141.59.jar &
script:
- npm install
- CHROMEDRIVER_VERSION=LATEST npm install chromedriver
# Run tests
- if [ $TRAVIS_BRANCH == "master" ] ; then
echo "Production build so only running unit tests, which don't hit the database";
./node_modules/.bin/jest --runInBand ./tests/unit/;
else
echo "Non-production build so running all tests. The database will be cleared as part of these tests.";
./node_modules/.bin/jest --runInBand;
fi
after_success:
# If the tests pass on Staging, push the commits to Production
- if [ $TRAVIS_BRANCH == "staging" ] ; then
git clone https://${GITHUB_TOKEN}@github.com/mongodb-developer/SocialStats.git;
cd SocialStats;
git checkout master;
git merge origin/staging;
git push origin master;
fi