#!/bin/bash

# The script unifies the test scripts.
#
# It's used as the main Travis CI script.

set -ex

export PATH="$(yarn bin):$PATH"

function prebuild {
  env BUILD_TESTS=true webpack-cli --config ./config/webpack.js
}

if [ "$TEST_SUITE" == "main" ]
then
  yarn lint
  flow check
  yarn lint-types
  ./scripts/test/systemJS.js
  yarn locale-snapshots test
  ./scripts/test/smoke.sh

  yarn test --single-run

  ./scripts/test/dst.sh
  ./scripts/test/formatISO.sh

  prebuild
  ./scripts/test/tz.sh

elif [ "$TEST_SUITE" == "tz" ]
then
  prebuild
  ./scripts/test/tzExtended.sh

elif [ "$TEST_SUITE" == "cross_browser" ] && [ "$SAUCE_USERNAME" != "" ]
then
  yarn test-cross-browser
  env TEST_CROSS_BROWSER=true yarn test --single-run

elif [ "$TEST_SUITE" == "node" ]
then
  ./scripts/test/node.sh

else
  printf "\n\033[0;31m" "UNKNOWN SUITE!" "\033[0m\n"
  exit 1
fi

./scripts/test/countTests.sh

#!/bin/bash

# The script unifies the test scripts.
#
# It's used as the main Travis CI script.

set -ex

export PATH="$(yarn bin):$PATH"

function prebuild {
  env BUILD_TESTS=true webpack-cli --config ./config/webpack.js
}

if [ "$TEST_SUITE" == "main" ]
then
  yarn lint
  yarn lint-types
  ./scripts/test/systemJS.js
  yarn locale-snapshots test
  ./scripts/test/smoke.sh

  yarn test --single-run

  ./scripts/test/dst.sh
  ./scripts/test/formatISO.sh

  prebuild
  ./scripts/test/tz.sh

elif [ "$TEST_SUITE" == "tz" ]
then
  prebuild
  ./scripts/test/tzExtended.sh

elif [ "$TEST_SUITE" == "cross_browser" ] && [ "$SAUCE_USERNAME" != "" ]
then
  yarn test-cross-browser
  env TEST_CROSS_BROWSER=true yarn test --single-run

elif [ "$TEST_SUITE" == "node" ]
then
  ./scripts/test/node.sh

else
  printf "\n\033[0;31m" "UNKNOWN SUITE!" "\033[0m\n"
  exit 1
fi

./scripts/test/countTests.sh

Remove flow check from CI flow
Remove flow check from CI flow

This check never captured any real error but
threw false-positive errors all the time.

I say enough.
