Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable and fix create-next-app integration tests #68084

Merged
merged 3 commits into from
Jul 25, 2024

Commits on Jul 25, 2024

  1. Re-enable create-next-app integration tests

    These tests were disabled as part of #65845, probably due to mismatching
    peer dependency errors. This has been resolved in the meantime.
    
    Note: The test `create-next-app with package manager bun` is still
    skipped due to the following error when trying to install
    `next-packed.tgz` in the temporary install dir:
    
    ```
    ENOENT extracting tarball from next
    ```
    
    This may be investigated further at a later point.
    unstubbable committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    5ac2a55 View commit details
    Browse the repository at this point in the history
  2. Avoid doing the work of createNextInstall twice

    The `run-tests.js` script already calls `createNextInstall` and does all
    the heavy lifting. Calling it again in the `create-next-app` integration
    tests is wasteful.
    
    In addition, the built `next` tarball is exposed by `run-tests.js` via
    the `NEXT_TEST_PKG_PATHS` env variable. We need to provide the filename
    of the tgz as `NEXT_PRIVATE_TEST_VERSION` so that `create-next-app` uses
    it in the generated `package.json` as the `next` dependency "version".
    
    With the previous approach, the installation was pointing `next` at the
    `installDir`, which has it's own version of React installed. This
    created runtime errors (`TypeError: Cannot read properties of null
    (reading 'useContext')`) when running `next dev` in a pages project that
    was created with `create-next-app`.
    unstubbable committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    b185c71 View commit details
    Browse the repository at this point in the history
  3. No need to install pnpm

    unstubbable committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    a9ebcc9 View commit details
    Browse the repository at this point in the history