test: add prettier e2e test (#14058)

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
Huáng Jùnliàng 2022-01-13 12:38:45 -05:00 committed by GitHub
parent 4ac8f7704c
commit ab2c578f98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 0 deletions

View File

@ -166,6 +166,14 @@ jobs:
at: /tmp/verdaccio-workspace at: /tmp/verdaccio-workspace
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-jest.sh - run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-jest.sh
e2e-breaking-prettier:
executor: node-executor
steps:
- checkout
- attach_workspace:
at: /tmp/verdaccio-workspace
- run: BABEL_8_BREAKING=true ./scripts/integration-tests/e2e-prettier.sh
workflows: workflows:
version: 2 version: 2
build-standalone: build-standalone:
@ -245,3 +253,6 @@ workflows:
- e2e-breaking-jest: - e2e-breaking-jest:
requires: requires:
- publish-verdaccio-babel-8-breaking - publish-verdaccio-babel-8-breaking
- e2e-breaking-prettier:
requires:
- publish-verdaccio-babel-8-breaking

View File

@ -446,6 +446,7 @@ jobs:
- vue-cli - vue-cli
- jest - jest
- react-native - react-native
- prettier
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -0,0 +1,45 @@
#!/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