Unverified Commit ff366ed0 authored by Sebastian Silbermann's avatar Sebastian Silbermann Committed by GitHub

Remove redundant React dependency declarations in test (#66530)

parent 82fe21f0
...@@ -405,7 +405,8 @@ ${ENDGROUP}`) ...@@ -405,7 +405,8 @@ ${ENDGROUP}`)
// a starter Next.js install to re-use to speed up tests // a starter Next.js install to re-use to speed up tests
// to avoid having to run yarn each time // to avoid having to run yarn each time
console.log(`${GROUP}Creating Next.js install for isolated tests`) console.log(`${GROUP}Creating Next.js install for isolated tests`)
const reactVersion = process.env.NEXT_TEST_REACT_VERSION || 'beta' const reactVersion =
process.env.NEXT_TEST_REACT_VERSION || '19.0.0-rc-f994737d14-20240522'
const { installDir, pkgPaths, tmpRepoDir } = await createNextInstall({ const { installDir, pkgPaths, tmpRepoDir } = await createNextInstall({
parentSpan: mockTrace(), parentSpan: mockTrace(),
dependencies: { dependencies: {
......
...@@ -7,10 +7,6 @@ import { outdent } from 'outdent' ...@@ -7,10 +7,6 @@ import { outdent } from 'outdent'
describe('ReactRefresh app', () => { describe('ReactRefresh app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,10 +8,6 @@ import { outdent } from 'outdent' ...@@ -8,10 +8,6 @@ import { outdent } from 'outdent'
describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => { describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -11,8 +11,6 @@ describe.skip('ReactRefreshLogBox scss app', () => { ...@@ -11,8 +11,6 @@ describe.skip('ReactRefreshLogBox scss app', () => {
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
sass: 'latest', sass: 'latest',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -14,10 +14,6 @@ const IS_TURBOPACK = Boolean(process.env.TURBOPACK) ...@@ -14,10 +14,6 @@ const IS_TURBOPACK = Boolean(process.env.TURBOPACK)
describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => { describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,10 +8,6 @@ import { outdent } from 'outdent' ...@@ -8,10 +8,6 @@ import { outdent } from 'outdent'
describe.skip('ReactRefreshLogBox app', () => { describe.skip('ReactRefreshLogBox app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -6,10 +6,6 @@ import { outdent } from 'outdent' ...@@ -6,10 +6,6 @@ import { outdent } from 'outdent'
describe('ReactRefreshModule app', () => { describe('ReactRefreshModule app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -12,8 +12,6 @@ describe('ReactRefreshRegression app', () => { ...@@ -12,8 +12,6 @@ describe('ReactRefreshRegression app', () => {
'styled-components': '5.1.0', 'styled-components': '5.1.0',
'@next/mdx': 'canary', '@next/mdx': 'canary',
'@mdx-js/loader': '0.18.0', '@mdx-js/loader': '0.18.0',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
skipStart: true, skipStart: true,
}) })
......
...@@ -7,10 +7,6 @@ import { outdent } from 'outdent' ...@@ -7,10 +7,6 @@ import { outdent } from 'outdent'
describe('ReactRefreshRequire app', () => { describe('ReactRefreshRequire app', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -28,10 +28,6 @@ async function clickImportTraceFiles(browser: any) { ...@@ -28,10 +28,6 @@ async function clickImportTraceFiles(browser: any) {
describe('Error overlay - editor links', () => { describe('Error overlay - editor links', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -6,10 +6,6 @@ import { outdent } from 'outdent' ...@@ -6,10 +6,6 @@ import { outdent } from 'outdent'
describe('Error overlay - error message urls', () => { describe('Error overlay - error message urls', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,10 +8,6 @@ import { outdent } from 'outdent' ...@@ -8,10 +8,6 @@ import { outdent } from 'outdent'
describe.each(['default', 'turbo'])('Error recovery app %s', () => { describe.each(['default', 'turbo'])('Error recovery app %s', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -10,10 +10,6 @@ import { getRedboxTotalErrorCount } from 'next-test-utils' ...@@ -10,10 +10,6 @@ import { getRedboxTotalErrorCount } from 'next-test-utils'
describe('Error overlay for hydration errors', () => { describe('Error overlay for hydration errors', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,8 +8,6 @@ describe('Error Overlay invalid imports', () => { ...@@ -8,8 +8,6 @@ describe('Error Overlay invalid imports', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
'client-only': 'latest', 'client-only': 'latest',
}, },
......
...@@ -7,10 +7,6 @@ import { outdent } from 'outdent' ...@@ -7,10 +7,6 @@ import { outdent } from 'outdent'
describe('Error overlay - RSC build errors', () => { describe('Error overlay - RSC build errors', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-build-errors')), files: new FileRef(path.join(__dirname, 'fixtures', 'rsc-build-errors')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,10 +8,6 @@ import { outdent } from 'outdent' ...@@ -8,10 +8,6 @@ import { outdent } from 'outdent'
describe('Error Overlay for server components', () => { describe('Error Overlay for server components', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -7,10 +7,6 @@ import path from 'path' ...@@ -7,10 +7,6 @@ import path from 'path'
describe('Error overlay for hydration errors', () => { describe('Error overlay for hydration errors', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -27,10 +27,6 @@ const initialFiles = new Map([ ...@@ -27,10 +27,6 @@ const initialFiles = new Map([
describe('Error Overlay for server components compiler errors in pages', () => { describe('Error Overlay for server components compiler errors in pages', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: {}, files: {},
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
skipStart: true, skipStart: true,
}) })
......
...@@ -8,8 +8,6 @@ describe('Deprecated @next/font warning', () => { ...@@ -8,8 +8,6 @@ describe('Deprecated @next/font warning', () => {
'pages/index.js': '', 'pages/index.js': '',
}, },
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'@next/font': 'canary', '@next/font': 'canary',
}, },
skipStart: true, skipStart: true,
......
...@@ -7,8 +7,6 @@ describe('app-dir action allowed origins', () => { ...@@ -7,8 +7,6 @@ describe('app-dir action allowed origins', () => {
files: join(__dirname, 'safe-origins'), files: join(__dirname, 'safe-origins'),
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
// An arbitrary & random port. // An arbitrary & random port.
......
...@@ -7,8 +7,6 @@ describe('app-dir action disallowed origins', () => { ...@@ -7,8 +7,6 @@ describe('app-dir action disallowed origins', () => {
files: join(__dirname, 'unsafe-origins'), files: join(__dirname, 'unsafe-origins'),
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
......
...@@ -6,8 +6,6 @@ describe('app-dir action handling - next export', () => { ...@@ -6,8 +6,6 @@ describe('app-dir action handling - next export', () => {
skipStart: true, skipStart: true,
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
......
...@@ -5,10 +5,6 @@ import { check } from 'next-test-utils' ...@@ -5,10 +5,6 @@ import { check } from 'next-test-utils'
describe('app-dir action useActionState', () => { describe('app-dir action useActionState', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
it('should support submitting form state with JS', async () => { it('should support submitting form state with JS', async () => {
const browser = await next.browser('/client/form-state') const browser = await next.browser('/client/form-state')
......
...@@ -7,9 +7,7 @@ describe('app-dir action progressive enhancement', () => { ...@@ -7,9 +7,7 @@ describe('app-dir action progressive enhancement', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
nanoid: 'latest', nanoid: 'latest',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
......
...@@ -11,8 +11,6 @@ describe('app-dir action size limit invalid config', () => { ...@@ -11,8 +11,6 @@ describe('app-dir action size limit invalid config', () => {
skipDeployment: true, skipDeployment: true,
skipStart: true, skipStart: true,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
......
...@@ -19,9 +19,7 @@ describe('app-dir action handling', () => { ...@@ -19,9 +19,7 @@ describe('app-dir action handling', () => {
nextTestSetup({ nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
nanoid: 'latest', nanoid: 'latest',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'server-only': 'latest', 'server-only': 'latest',
}, },
}) })
......
...@@ -6,8 +6,6 @@ describe('app dir - css with pageextensions', () => { ...@@ -6,8 +6,6 @@ describe('app dir - css with pageextensions', () => {
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
'@picocss/pico': '1.5.7', '@picocss/pico': '1.5.7',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
sass: 'latest', sass: 'latest',
}, },
}) })
......
...@@ -7,8 +7,6 @@ describe('app dir - css', () => { ...@@ -7,8 +7,6 @@ describe('app dir - css', () => {
skipDeployment: true, skipDeployment: true,
dependencies: { dependencies: {
'@picocss/pico': '1.5.7', '@picocss/pico': '1.5.7',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
sass: 'latest', sass: 'latest',
'@next/mdx': 'canary', '@next/mdx': 'canary',
}, },
......
...@@ -4,10 +4,6 @@ import path from 'path' ...@@ -4,10 +4,6 @@ import path from 'path'
describe('referencing a client component in an app route', () => { describe('referencing a client component in an app route', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname)), files: new FileRef(path.join(__dirname)),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
it('responds without error', async () => { it('responds without error', async () => {
......
...@@ -73,10 +73,6 @@ import stripAnsi from 'strip-ansi' ...@@ -73,10 +73,6 @@ import stripAnsi from 'strip-ansi'
path.join(__dirname, 'next.config.js') path.join(__dirname, 'next.config.js')
), ),
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -127,10 +123,6 @@ import stripAnsi from 'strip-ansi' ...@@ -127,10 +123,6 @@ import stripAnsi from 'strip-ansi'
path.join(__dirname, 'next.config.js') path.join(__dirname, 'next.config.js')
), ),
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -236,10 +228,6 @@ import stripAnsi from 'strip-ansi' ...@@ -236,10 +228,6 @@ import stripAnsi from 'strip-ansi'
path.join(__dirname, 'next.config.js') path.join(__dirname, 'next.config.js')
), ),
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
await expect(next.start()).rejects.toThrow('next build failed') await expect(next.start()).rejects.toThrow('next build failed')
......
...@@ -9,8 +9,6 @@ describe('navigation between pages and app dir', () => { ...@@ -9,8 +9,6 @@ describe('navigation between pages and app dir', () => {
next = await createNext({ next = await createNext({
files: new FileRef(__dirname), files: new FileRef(__dirname),
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',
......
...@@ -4,8 +4,6 @@ describe('redirects and rewrites', () => { ...@@ -4,8 +4,6 @@ describe('redirects and rewrites', () => {
const { next } = nextTestSetup({ const { next } = nextTestSetup({
files: __dirname, files: __dirname,
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
typescript: 'latest', typescript: 'latest',
'@types/react': 'latest', '@types/react': 'latest',
'@types/node': 'latest', '@types/node': 'latest',
......
...@@ -17,8 +17,6 @@ describe('New Link Behavior with <a> child', () => { ...@@ -17,8 +17,6 @@ describe('New Link Behavior with <a> child', () => {
}, },
dependencies: { dependencies: {
next: 'latest', next: 'latest',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
}) })
}) })
......
...@@ -24,8 +24,6 @@ describe('New Link Behavior with material-ui', () => { ...@@ -24,8 +24,6 @@ describe('New Link Behavior with material-ui', () => {
'@mui/material': 'latest', '@mui/material': 'latest',
next: 'latest', next: 'latest',
'prop-types': 'latest', 'prop-types': 'latest',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
// Use minimum peer dep version instead of v9 of eslint to avoid breaking changes // Use minimum peer dep version instead of v9 of eslint to avoid breaking changes
eslint: '8.56.0', eslint: '8.56.0',
'eslint-config-next': 'latest', 'eslint-config-next': 'latest',
......
...@@ -21,8 +21,6 @@ describe('New Link Behavior with stitches', () => { ...@@ -21,8 +21,6 @@ describe('New Link Behavior with stitches', () => {
dependencies: { dependencies: {
'@stitches/react': '^1.2.6', '@stitches/react': '^1.2.6',
next: 'latest', next: 'latest',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
}) })
}) })
......
...@@ -29,10 +29,6 @@ describe('next/font/google with proxy', () => { ...@@ -29,10 +29,6 @@ describe('next/font/google with proxy', () => {
next = await createNext({ next = await createNext({
files: new FileRef(join(__dirname, 'with-proxy')), files: new FileRef(join(__dirname, 'with-proxy')),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
env: { env: {
http_proxy: 'http://localhost:' + PROXY_PORT, http_proxy: 'http://localhost:' + PROXY_PORT,
}, },
......
...@@ -40,10 +40,6 @@ describe('beforeInteractive in document Head', () => { ...@@ -40,10 +40,6 @@ describe('beforeInteractive in document Head', () => {
} }
`, `,
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -100,10 +96,6 @@ describe('beforeInteractive in document body', () => { ...@@ -100,10 +96,6 @@ describe('beforeInteractive in document body', () => {
} }
`, `,
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -161,10 +153,6 @@ describe('empty strategy in document Head', () => { ...@@ -161,10 +153,6 @@ describe('empty strategy in document Head', () => {
} }
`, `,
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -220,10 +208,6 @@ describe('empty strategy in document body', () => { ...@@ -220,10 +208,6 @@ describe('empty strategy in document body', () => {
} }
`, `,
}, },
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -267,11 +251,6 @@ describe('empty strategy in document body', () => { ...@@ -267,11 +251,6 @@ describe('empty strategy in document body', () => {
} }
`, `,
}, },
// TODO: @housseindjirdeh: verify React 18 functionality
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
}) })
afterAll(() => next.destroy()) afterAll(() => next.destroy())
...@@ -320,8 +299,6 @@ describe('empty strategy in document body', () => { ...@@ -320,8 +299,6 @@ describe('empty strategy in document body', () => {
`, `,
}, },
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'@builder.io/partytown': '0.4.2', '@builder.io/partytown': '0.4.2',
}, },
}) })
...@@ -409,8 +386,6 @@ describe('empty strategy in document body', () => { ...@@ -409,8 +386,6 @@ describe('empty strategy in document body', () => {
`, `,
}, },
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
'@builder.io/partytown': '0.4.2', '@builder.io/partytown': '0.4.2',
}, },
}) })
...@@ -525,8 +500,6 @@ describe('empty strategy in document body', () => { ...@@ -525,8 +500,6 @@ describe('empty strategy in document body', () => {
}, },
dependencies: { dependencies: {
'@builder.io/partytown': '0.4.2', '@builder.io/partytown': '0.4.2',
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
}) })
}) })
......
...@@ -43,10 +43,6 @@ describe('Switchable runtime', () => { ...@@ -43,10 +43,6 @@ describe('Switchable runtime', () => {
beforeAll(async () => { beforeAll(async () => {
next = await createNext({ next = await createNext({
files: new FileRef(__dirname), files: new FileRef(__dirname),
dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
},
}) })
context = { context = {
appPort: next.url, appPort: next.url,
......
...@@ -16,8 +16,6 @@ describe('transpile packages', () => { ...@@ -16,8 +16,6 @@ describe('transpile packages', () => {
next = await createNext({ next = await createNext({
files: new FileRef(path.join(__dirname, './npm')), files: new FileRef(path.join(__dirname, './npm')),
dependencies: { dependencies: {
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
sass: 'latest', sass: 'latest',
}, },
packageJson: { packageJson: {
......
...@@ -29,6 +29,11 @@ export function runTests( ...@@ -29,6 +29,11 @@ export function runTests(
const srcFiles = await fs.readdir(srcDir) const srcFiles = await fs.readdir(srcDir)
const packageJson = await fs.readJson(join(srcDir, 'package.json')) const packageJson = await fs.readJson(join(srcDir, 'package.json'))
// Use the default versions that are usually used in tests.
// Since we replace `next` in the install, we also need to fulfill the peerDependencies.
// However, the example specified latest next which may have different peerDependencies that the next that we test here i.e. the next on this commit.
delete packageJson.dependencies['react']
delete packageJson.dependencies['react-dom']
next = await createNext({ next = await createNext({
files: srcFiles.reduce( files: srcFiles.reduce(
...@@ -43,8 +48,6 @@ export function runTests( ...@@ -43,8 +48,6 @@ export function runTests(
dependencies: { dependencies: {
...packageJson.dependencies, ...packageJson.dependencies,
...packageJson.devDependencies, ...packageJson.devDependencies,
react: '19.0.0-rc-f994737d14-20240522',
'react-dom': '19.0.0-rc-f994737d14-20240522',
}, },
installCommand: ({ dependencies }) => { installCommand: ({ dependencies }) => {
const pkgs = Object.keys(dependencies).reduce((prev, cur) => { const pkgs = Object.keys(dependencies).reduce((prev, cur) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment