forked from algolia/algoliasearch-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-node
More file actions
executable file
路51 lines (39 loc) 路 1.39 KB
/
Copy pathtest-node
File metadata and controls
executable file
路51 lines (39 loc) 路 1.39 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
#!/usr/bin/env bash
if [ -x "$(command -v brew)" ] && [ -x "$(brew --prefix nvm)" ]; then
source $(brew --prefix nvm)/nvm.sh
else
source ~/.nvm/nvm.sh
fi
set -e # exit when error
[ -z $TRAVIS_BUILD_NUMBER ] && CI='false' || CI='true'
[ -z $TRAVIS_PULL_REQUEST ] && TRAVIS_PULL_REQUEST='false'
[ -z $TRAVIS_BUILD_NUMBER ] && TRAVIS_BUILD_NUMBER='false'
# nvm has a special setup on Travis where it might break installing other versions
unset npm_config_prefix
nvm install 7
node test/run-node.js | tap-bail | tap-dot
# in CI we launch integration test
[ $CI == 'true' ] && echo "Node test stable: integration" && node test/run-integration.js
# in a PR or in local environement, test only on node 6
if [ $TRAVIS_PULL_REQUEST != 'false' ] || [ $CI == 'false' ]; then
echo 'Skipping other nodejs version testing (PR or local)'
exit 0
else
echo "Node test 0.10: integration"
nvm install 0.10
node test/run-integration.js | tap-bail | tap-dot
echo "Node test 0.12: integration"
nvm install 0.12
node test/run-integration.js | tap-bail | tap-dot
echo "Node test 4: integration"
nvm install 4
node test/run-integration.js | tap-bail | tap-dot
echo "Node test 5: integration"
nvm install 5
node test/run-integration.js | tap-bail | tap-dot
echo "Node test 6: integration"
nvm install 6
node test/run-integration.js | tap-bail | tap-dot
fi
# switch back to node.js stable
nvm use 7