#!/usr/bin/env bash

set -o pipefail

if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
  source ~/.nvm/nvm.sh
else
  npm config delete prefix
  source ~/.bashrc
fi
nvm use --delete-prefix ${NODE_VERSION}

if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
  sudo xvfb-run --auto-servernum --server-num=1 -s "-ac -screen 0 1280x1024x24" `which glxinfo`

  sudo xvfb-run --auto-servernum --server-num=1 -s "-ac -screen 0 1280x1024x24" `which npm` test
#else
#  npm test
fi
