File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ export function useFixture(options: {
166
166
export async function setupIsolatedFixture ( options : {
167
167
src : string
168
168
dest : string
169
+ overrides ?: Record < string , string >
169
170
} ) {
170
171
// copy fixture
171
172
fs . rmSync ( options . dest , { recursive : true , force : true } )
@@ -184,10 +185,16 @@ export async function setupIsolatedFixture(options: {
184
185
/ o v e r r i d e s : \s * ( [ \s \S ] * ?) (? = \n \w | \n * $ ) / ,
185
186
)
186
187
const overridesSection = overridesMatch ? overridesMatch [ 0 ] : 'overrides:'
188
+ const overrides = {
189
+ '@vitejs/plugin-rsc' : `file:${ path . join ( rootDir , 'packages/plugin-rsc' ) } ` ,
190
+ '@vitejs/plugin-react' : `file:${ path . join ( rootDir , 'packages/plugin-react' ) } ` ,
191
+ ...options . overrides ,
192
+ }
187
193
const tempWorkspaceYaml = `\
188
194
${ overridesSection }
189
- '@vitejs/plugin-rsc': ${ JSON . stringify ( 'file:' + path . join ( rootDir , 'packages/plugin-rsc' ) ) }
190
- '@vitejs/plugin-react': ${ JSON . stringify ( 'file:' + path . join ( rootDir , 'packages/plugin-react' ) ) }
195
+ ${ Object . entries ( overrides )
196
+ . map ( ( [ k , v ] ) => ` ${ JSON . stringify ( k ) } : ${ JSON . stringify ( v ) } ` )
197
+ . join ( '\n' ) }
191
198
`
192
199
fs . writeFileSync (
193
200
path . join ( options . dest , 'pnpm-workspace.yaml' ) ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { setupIsolatedFixture, useFixture } from './fixture'
3
3
import { defineStarterTest } from './starter'
4
4
import path from 'node:path'
5
5
import os from 'node:os'
6
+ import * as vite from 'vite'
6
7
7
8
test . describe ( ( ) => {
8
9
// use RUNNER_TEMP on Github Actions
@@ -25,3 +26,31 @@ test.describe(() => {
25
26
defineStarterTest ( f )
26
27
} )
27
28
} )
29
+
30
+ test . describe ( 'vite 6' , ( ) => {
31
+ test . skip ( ! ! process . env . ECOSYSTEM_CI || 'rolldownVersion' in vite )
32
+
33
+ const tmpRoot = path . join (
34
+ process . env [ 'RUNNER_TEMP' ] || os . tmpdir ( ) ,
35
+ 'test-vite-rsc-vite-6' ,
36
+ )
37
+ test . beforeAll ( async ( ) => {
38
+ await setupIsolatedFixture ( {
39
+ src : 'examples/starter' ,
40
+ dest : tmpRoot ,
41
+ overrides : {
42
+ vite : '^6' ,
43
+ } ,
44
+ } )
45
+ } )
46
+
47
+ test . describe ( 'dev' , ( ) => {
48
+ const f = useFixture ( { root : tmpRoot , mode : 'dev' } )
49
+ defineStarterTest ( f )
50
+ } )
51
+
52
+ test . describe ( 'build' , ( ) => {
53
+ const f = useFixture ( { root : tmpRoot , mode : 'build' } )
54
+ defineStarterTest ( f )
55
+ } )
56
+ } )
You can’t perform that action at this time.
0 commit comments