Skip to content

Commit

Permalink
Re-enable Prettier Babel 8 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Aug 2, 2023
1 parent 48b05ac commit cba0c7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-breaking-esm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# todo: Enable this test when metro-source-map does not reassign NodePath cache
# https://github.com/facebook/metro/blob/29bb5f2ad3319ba8f4764c3993aa85c15f59af23/packages/metro-source-map/src/generateFunctionMap.js#L182
# react-native
# - prettier
- prettier
# - angular-cli
steps:
- name: Get yarn1 cache directory path
Expand Down
9 changes: 9 additions & 0 deletions scripts/integration-tests/e2e-prettier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ cd tmp/prettier || exit
bump_deps="$root/utils/bump-babel-dependencies.js"
node "$bump_deps"

if [ "$BABEL_8_BREAKING" = true ] ; then
# Based on https://github.com/prettier/prettier/pull/15157
sed -i 's/const getChalk = () => chalk/default (code) => code/' scripts/build/shims/babel-highlight.js
sed -i 's/const generate = babelGenerator.default/const generate = babelGenerator/' scripts/build/transform/eastasianwidth-module.js
sed -i 's/const generate = babelGenerator.default/const generate = babelGenerator/' scripts/build/transform/index.js
sed -i 's/,"updateContext":null//g' tests/integration/__tests__/__snapshots__/debug-print-ast.js.snap
rm tests/unit/__snapshots__/visitor-keys.js.snap
fi

#==============================================================================#
# ENVIRONMENT #
#==============================================================================#
Expand Down

0 comments on commit cba0c7f

Please sign in to comment.