Skip to content

Commit

Permalink
Stop installing React in tests
Browse files Browse the repository at this point in the history
It shouldn't be used by Next.js anyway.
It's just installed for code that isn't executed by Next.js
  • Loading branch information
eps1lon committed Apr 21, 2024
1 parent 4df94e1 commit 375cad9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 0 additions & 5 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,8 @@ ${ENDGROUP}`)
// a starter Next.js install to re-use to speed up tests
// to avoid having to run yarn each time
console.log(`${GROUP}Creating Next.js install for isolated tests`)
const reactVersion = process.env.NEXT_TEST_REACT_VERSION || 'latest'
const { installDir, pkgPaths, tmpRepoDir } = await createNextInstall({
parentSpan: mockTrace(),
dependencies: {
react: reactVersion,
'react-dom': reactVersion,
},
keepRepoDir: true,
})

Expand Down
7 changes: 2 additions & 5 deletions test/lib/next-modes/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,9 @@ export class NextInstance {
}`
)

const reactVersion = process.env.NEXT_TEST_REACT_VERSION || 'latest'
const finalDependencies = {
react: reactVersion,
'react-dom': reactVersion,
'@types/react': reactVersion,
'@types/react-dom': reactVersion,
'@types/react': 'latest',
'@types/react-dom': 'latest',
typescript: 'latest',
'@types/node': 'latest',
...this.dependencies,
Expand Down

0 comments on commit 375cad9

Please sign in to comment.