Skip to content

Commit d4f5336

Browse files
Merge branch 'canary' into upgrade-react-to-d6dcad6a8
2 parents ecf600b + e23dac0 commit d4f5336

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

test/e2e/app-dir/rsc-basic/rsc-basic.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ createNextDescribe(
2222
'styled-components': 'latest',
2323
'server-only': 'latest',
2424
},
25+
resolutions: {
26+
'@babel/core': '7.22.18',
27+
'@babel/parser': '7.22.16',
28+
'@babel/types': '7.22.17',
29+
'@babel/traverse': '7.22.18',
30+
},
2531
},
2632
({ next, isNextDev, isNextStart, isTurbopack }) => {
2733
if (isNextDev && !isTurbopack) {

test/lib/create-next-install.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function setPnpmResolutionMode(cwd) {
3131
async function createNextInstall({
3232
parentSpan = null,
3333
dependencies = null,
34+
resolutions = null,
3435
installCommand = null,
3536
packageJson = {},
3637
dirSuffix = '',
@@ -148,6 +149,8 @@ async function createNextInstall({
148149
...packageJson,
149150
dependencies: combinedDependencies,
150151
private: true,
152+
// Add resolutions if provided.
153+
...(resolutions ? { resolutions } : {}),
151154
},
152155
null,
153156
2
@@ -158,7 +161,10 @@ async function createNextInstall({
158161
if (installCommand) {
159162
const installString =
160163
typeof installCommand === 'function'
161-
? installCommand({ dependencies: combinedDependencies })
164+
? installCommand({
165+
dependencies: combinedDependencies,
166+
resolutions,
167+
})
162168
: installCommand
163169

164170
console.log('running install command', installString)

test/lib/next-modes/base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export type PackageJson = {
2828
export interface NextInstanceOpts {
2929
files: FileRef | string | { [filename: string]: string | FileRef }
3030
dependencies?: { [name: string]: string }
31+
resolutions?: { [name: string]: string }
3132
packageJson?: PackageJson
3233
nextConfig?: NextConfig
3334
installCommand?: InstallCommand
@@ -56,6 +57,7 @@ export class NextInstance {
5657
protected buildCommand?: string
5758
protected startCommand?: string
5859
protected dependencies?: PackageJson['dependencies'] = {}
60+
protected resolutions?: PackageJson['resolutions']
5961
protected events: { [eventName: string]: Set<any> } = {}
6062
public testDir: string
6163
protected isStopping: boolean = false
@@ -168,6 +170,7 @@ export class NextInstance {
168170
process.env.NEXT_TEST_VERSION ||
169171
require('next/package.json').version,
170172
},
173+
...(this.resolutions ? { resolutions: this.resolutions } : {}),
171174
scripts: {
172175
// since we can't get the build id as a build artifact, make it
173176
// available under the static files
@@ -196,6 +199,7 @@ export class NextInstance {
196199
this.testDir = await createNextInstall({
197200
parentSpan: rootSpan,
198201
dependencies: finalDependencies,
202+
resolutions: this.resolutions ?? null,
199203
installCommand: this.installCommand,
200204
packageJson: this.packageJson,
201205
dirSuffix: this.dirSuffix,

0 commit comments

Comments
 (0)