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: {
166166export async function setupIsolatedFixture ( options : {
167167 src : string
168168 dest : string
169+ overrides ?: Record < string , string >
169170} ) {
170171 // copy fixture
171172 fs . rmSync ( options . dest , { recursive : true , force : true } )
@@ -184,10 +185,16 @@ export async function setupIsolatedFixture(options: {
184185 / o v e r r i d e s : \s * ( [ \s \S ] * ?) (? = \n \w | \n * $ ) / ,
185186 )
186187 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+ }
187193 const tempWorkspaceYaml = `\
188194${ 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' ) }
191198`
192199 fs . writeFileSync (
193200 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'
33import { defineStarterTest } from './starter'
44import path from 'node:path'
55import os from 'node:os'
6+ import * as vite from 'vite'
67
78test . describe ( ( ) => {
89 // use RUNNER_TEMP on Github Actions
@@ -25,3 +26,31 @@ test.describe(() => {
2526 defineStarterTest ( f )
2627 } )
2728} )
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