fix deploy tests that patch node_modules (#66849)
`node_modules` gets ignored when deployed unless explicitly allowed, and the regular install command will clobber what was in there. This allowlists the `node_modules` directory and copies it into a new folder, runs the install command, and then merges the patched `node_modules` in so the patched modules are available in the test.
This commit is contained in:
parent
d8f1a5d30f
commit
4dd26753d9
11 changed files with 25 additions and 5 deletions
|
@ -24,7 +24,6 @@
|
|||
"test/production/**/*.test.{t,j}s{,x}"
|
||||
],
|
||||
"exclude": [
|
||||
"test/e2e/app-dir/scss/nm-module-nested/nm-module-nested.test.ts",
|
||||
"test/e2e/cancel-request/stream-cancel.test.ts",
|
||||
"test/e2e/new-link-behavior/material-ui.test.ts",
|
||||
"test/e2e/react-dnd-compile/react-dnd-compile.test.ts",
|
||||
|
@ -33,17 +32,14 @@
|
|||
"test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts",
|
||||
"test/e2e/swc-warnings/index.test.ts",
|
||||
"test/e2e/third-parties/index.test.ts",
|
||||
"test/e2e/app-dir/app-routes-client-component/app-routes-client-component.test.ts",
|
||||
"test/e2e/app-dir/app-routes/app-custom-route-base-path.test.ts",
|
||||
"test/e2e/app-dir/mdx/mdx.test.ts",
|
||||
"test/e2e/app-dir/modularizeimports/modularizeimports.test.ts",
|
||||
"test/e2e/app-dir/third-parties/basic.test.ts",
|
||||
"test/e2e/esm-externals/esm-externals.test.ts",
|
||||
"test/e2e/app-dir/actions-navigation/index.test.ts",
|
||||
"test/e2e/app-dir/app-static/app-static-custom-handler.test.ts",
|
||||
"test/e2e/app-dir/options-request/options-request.test.ts",
|
||||
"test/e2e/app-dir/revalidate-dynamic/revalidate-dynamic.test.ts",
|
||||
"test/e2e/app-dir/scss/npm-import-nested/npm-import-nested.test.ts",
|
||||
"test/e2e/app-dir/syntax-highlighter-crash/syntax-highlighter-crash.test.ts",
|
||||
"test/e2e/new-link-behavior/stitches.test.ts",
|
||||
"test/e2e/next-image-forward-ref/index.test.ts",
|
||||
|
@ -51,7 +47,6 @@
|
|||
"test/e2e/app-dir/i18n-hybrid/i18n-hybrid.test.js",
|
||||
"test/e2e/app-dir/metadata/metadata.test.ts",
|
||||
"test/e2e/app-dir/rsc-basic/rsc-basic.test.ts",
|
||||
"test/e2e/app-dir/scss/nm-module/nm-module.test.ts",
|
||||
"test/e2e/basepath.test.ts",
|
||||
"test/e2e/postcss-config-cjs/index.test.ts",
|
||||
"test/e2e/socket-io/index.test.js",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
!node_modules
|
4
test/e2e/app-dir/app-routes-client-component/vercel.json
Normal file
4
test/e2e/app-dir/app-routes-client-component/vercel.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"installCommand": "mv node_modules node_modules.bak && npm i",
|
||||
"buildCommand": "cp -r node_modules.bak/* node_modules && npm run build"
|
||||
}
|
1
test/e2e/app-dir/scss/nm-module-nested/.vercelignore
Normal file
1
test/e2e/app-dir/scss/nm-module-nested/.vercelignore
Normal file
|
@ -0,0 +1 @@
|
|||
!node_modules
|
4
test/e2e/app-dir/scss/nm-module-nested/vercel.json
Normal file
4
test/e2e/app-dir/scss/nm-module-nested/vercel.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"installCommand": "mv node_modules node_modules.bak && npm i",
|
||||
"buildCommand": "cp -r node_modules.bak/* node_modules && npm run build"
|
||||
}
|
1
test/e2e/app-dir/scss/nm-module/.vercelignore
Normal file
1
test/e2e/app-dir/scss/nm-module/.vercelignore
Normal file
|
@ -0,0 +1 @@
|
|||
!node_modules
|
4
test/e2e/app-dir/scss/nm-module/vercel.json
Normal file
4
test/e2e/app-dir/scss/nm-module/vercel.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"installCommand": "mv node_modules node_modules.bak && npm i",
|
||||
"buildCommand": "cp -r node_modules.bak/* node_modules && npm run build"
|
||||
}
|
1
test/e2e/app-dir/scss/npm-import-nested/.vercelignore
Normal file
1
test/e2e/app-dir/scss/npm-import-nested/.vercelignore
Normal file
|
@ -0,0 +1 @@
|
|||
!node_modules
|
4
test/e2e/app-dir/scss/npm-import-nested/vercel.json
Normal file
4
test/e2e/app-dir/scss/npm-import-nested/vercel.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"installCommand": "mv node_modules node_modules.bak && npm i",
|
||||
"buildCommand": "cp -r node_modules.bak/* node_modules && npm run build"
|
||||
}
|
1
test/e2e/esm-externals/.vercelignore
Normal file
1
test/e2e/esm-externals/.vercelignore
Normal file
|
@ -0,0 +1 @@
|
|||
!node_modules
|
4
test/e2e/esm-externals/vercel.json
Normal file
4
test/e2e/esm-externals/vercel.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"installCommand": "mv node_modules node_modules.bak && npm i",
|
||||
"buildCommand": "cp -r node_modules.bak/* node_modules && npm run build"
|
||||
}
|
Loading…
Reference in a new issue