babel/scripts/integration-tests/e2e-prettier.sh
Huáng Jùnliàng ab2c578f98
test: add prettier e2e test (#14058)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2022-01-13 18:38:45 +01:00

46 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
#==============================================================================#
# SETUP #
#==============================================================================#
# Start in scripts/integration-tests/ even if run from root directory
cd "$(dirname "$0")" || exit
root="$PWD"
source utils/local-registry.sh
source utils/cleanup.sh
# Echo every command being executed
set -x
# Clone prettier
git clone --depth=1 https://github.com/prettier/prettier tmp/prettier
cd tmp/prettier || exit
# Update @babel/* dependencies
bump_deps="$root/utils/bump-babel-dependencies.js"
node "$bump_deps"
#==============================================================================#
# ENVIRONMENT #
#==============================================================================#
node -v
yarn --version
#==============================================================================#
# TEST #
#==============================================================================#
# Don't use Yarn 2
export YARN_IGNORE_PATH=1
startLocalRegistry "$root"/verdaccio-config.yml
yarn install
# Only run js,jsx,misc format tests
# Without --runInBand CircleCI hangs.
yarn test "tests/format/(jsx?|misc)/" --update-snapshot --runInBand
cleanup