endtoend-build-tests 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. set -o pipefail
  3. set -o errexit
  4. set -o nounset
  5. set -o xtrace
  6. # Set magic variables for current file & dir
  7. __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  8. __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
  9. __base="$(basename ${__file} .sh)"
  10. __root="$(cd "$(dirname "${__dir}")" && pwd)"
  11. # Tests using a simple build setup.
  12. tests="chaos-monkey i18n-drag-drop providers thumbnails transloadit transloadit-assembly-options tus-drag-drop url-plugin xhr-limit"
  13. for t in $tests; do
  14. mkdir -p "${__root}/test/endtoend/$t/dist"
  15. cp "${__root}/packages/uppy/dist/uppy.min.css" "${__root}/test/endtoend/$t/dist"
  16. cp "${__root}/test/endtoend/$t/index.html" "${__root}/test/endtoend/$t/dist"
  17. browserify "${__root}/test/endtoend/$t/main.js" \
  18. -o "${__root}/test/endtoend/$t/dist/bundle.js" \
  19. -t @goto-bus-stop/envify \
  20. -t babelify
  21. done
  22. # Speeecial tests that need custom builds.
  23. pushd "${__root}/test/endtoend/create-react-app"
  24. npm install
  25. REACT_APP_ON_TRAVIS="${TRAVIS:-}" npm run build
  26. popd
  27. pushd "${__root}/test/endtoend/typescript"
  28. mkdir -p dist
  29. cp "${__root}/packages/uppy/dist/uppy.min.css" dist/
  30. cp index.html dist/
  31. browserify main.ts -t @goto-bus-stop/envify -p [ tsify --target ES3 ] -o dist/bundle.js
  32. popd