Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/actions/next-stats-action/src/prepare/repo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ module.exports = (actionInfo) => {
// to the correct versions
for (const pkgName of pkgDatas.keys()) {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true, {
env: {
// Yarn installed through corepack will not run in pnpm project without this env var set
// This var works for corepack >=0.15.0
COREPACK_ENABLE_STRICT: '0',
},
})
}
return pkgPaths
},
Expand Down
7 changes: 7 additions & 0 deletions contributing/core/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ When the test runs it will open the browser that is in the background by default
pnpm testonly test/integration/production/ -t "should allow etag header support"
```

**End-to-end (e2e)** tests are run in complete isolation from the repository.
When you run an e2e test, a local version of next will be created inside your system's temp folder (eg. /tmp),
which is then linked to the app, also created inside a temp folder. A server is started on a random port, against which the tests will run.
After all tests have finished, the server is destroyed and all remaining files are deleted from the temp folder.

You will need `yarn` for running e2e tests. Installing it `corepack` won't work because `next.js` is `pnpm` workspace.

## Writing tests for Next.js

### Getting Started
Expand Down