rsnext/test-pnp.sh
Joe Haddad 04f37d0978
fix: load webpack hook before config is required (#22583)
This pull request ensures the webpack hook is installed before an attempt is made to load the configuration.

This pull request is tested by the PnP tests, which should now be passing as a result of this change.

---

Fixes #21679
2021-02-27 06:19:35 +00:00

43 lines
796 B
Bash
Executable file

declare -a testCases=(
# Tests the webpack require hook
"progressive-web-app"
"with-typescript"
"with-next-sass"
# Tests @next/mdx
"with-mdx"
# Tests babel config
"with-styled-components"
)
set -e
set -x
# Speeds up testing locally
export CI=1
rm -rf ./e2e-tests
initialDir=$(pwd)
for testCase in "${testCases[@]}"
do
cd $initialDir
echo "--- Testing $testCase ---"
mkdir -p "./e2e-tests/$testCase"
cp -r "./examples/$testCase/." "./e2e-tests/$testCase"
cd "./e2e-tests/$testCase"
touch yarn.lock
yarn set version berry
# Temporary fix for https://github.com/yarnpkg/berry/issues/2514:
yarn set version from sources
yarn config set pnpFallbackMode none
yarn config set enableGlobalCache true
yarn link --all --private -r ../..
yarn build
done