File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { readFileSync } from 'node:fs'
33import { type Page , expect , test } from '@playwright/test'
44import { type Fixture , setupIsolatedFixture , useFixture } from './fixture'
55import { expectNoReload , testNoJs , waitForHydration } from './helper'
6+ import path from 'node:path'
7+ import os from 'node:os'
68
79// TODO: parallel?
810// TODO: all tests don't need to be tested in all variants?
@@ -107,7 +109,12 @@ test.describe(() => {
107109 // disabled by default
108110 if ( process . env . TEST_ISOLATED !== 'true' ) return
109111
110- let tmpRoot = '/tmp/test-vite-rsc'
112+ // use RUNNER_TEMP on Github Actions
113+ // https://github.com/actions/toolkit/issues/518
114+ const tmpRoot = path . join (
115+ process . env [ 'RUNNER_TEMP' ] || os . tmpdir ( ) ,
116+ 'test-vite-rsc' ,
117+ )
111118 test . beforeAll ( async ( ) => {
112119 await setupIsolatedFixture ( { src : 'examples/basic' , dest : tmpRoot } )
113120 } )
Original file line number Diff line number Diff line change @@ -153,10 +153,9 @@ export async function setupIsolatedFixture(options: {
153153} ) {
154154 // copy fixture
155155 fs . rmSync ( options . dest , { recursive : true , force : true } )
156- fs . cpSync ( options . src , options . dest , { recursive : true } )
157- fs . rmSync ( path . join ( options . dest , 'node_modules' ) , {
156+ fs . cpSync ( options . src , options . dest , {
158157 recursive : true ,
159- force : true ,
158+ filter : ( src ) => ! src . includes ( 'node_modules' ) ,
160159 } )
161160
162161 // setup package.json overrides
@@ -174,7 +173,11 @@ export async function setupIsolatedFixture(options: {
174173 throwOnError : true ,
175174 nodeOptions : {
176175 cwd : options . dest ,
177- stdio : process . env . TEST_DEBUG ? 'inherit' : undefined ,
176+ stdio : [
177+ 'ignore' ,
178+ process . env . TEST_DEBUG ? 'inherit' : 'ignore' ,
179+ 'inherit' ,
180+ ] ,
178181 } ,
179182 } )
180183}
You can’t perform that action at this time.
0 commit comments