forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-pnp.sh
executable file
·46 lines (34 loc) · 918 Bytes
/
test-pnp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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"
# Ensure builds do not fail due to lint errors
echo "module.exports = { eslint: { build: false } }" > next.config.js
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