@@ -2,7 +2,7 @@ import { basename, dirname, join } from "node:path";
22import { createTempDir , readAllFiles , runBundler } from "../utils" ;
33import { fileURLToPath } from "node:url" ;
44import { rmSync } from "node:fs" ;
5- import { test as vitestTest } from "vitest" ;
5+ import { TestContext , test as vitestTest } from "vitest" ;
66import { execSync } from "node:child_process" ;
77
88const cwd = dirname ( fileURLToPath ( import . meta. url ) ) ;
@@ -14,6 +14,7 @@ type TestCallback = (props: {
1414 readOutputFiles : ( ) => Record < string , string > ;
1515 runFileInNode : ( file : string ) => string ;
1616 createTempDir : ( ) => string ;
17+ ctx : TestContext ;
1718} ) => void ;
1819
1920export function test ( url : string , callback : TestCallback ) {
@@ -30,7 +31,7 @@ export function test(url: string, callback: TestCallback) {
3031 // eslint-disable-next-line @typescript-eslint/no-empty-function
3132 vitestTest . skip ( testName ) ;
3233 } else {
33- vitestTest ( `rolldown > ${ testName } ` , ( ) =>
34+ vitestTest ( `rolldown > ${ testName } ` , ( ctx ) =>
3435 callback ( {
3536 outDir,
3637 runRolldown : ( env ) =>
@@ -54,6 +55,7 @@ export function test(url: string, callback: TestCallback) {
5455 } ) . toString ( ) ;
5556 } ,
5657 createTempDir : ( ) => createTempDir ( ) ,
58+ ctx,
5759 } )
5860 ) ;
5961 }
0 commit comments