11import { beforeEach , describe , expect , it , TestOptions } from 'vitest' ;
22import scalaJSPlugin , { ScalaJSPluginOptions } from "../index" ;
3- import type { PluginContext } from 'rolldown' ;
3+
44
55/* This interface refines the VitePlugin with some knowledge about our
66 * particular implementation, for easier testing. If we define here something
@@ -9,8 +9,8 @@ import type { PluginContext } from 'rolldown';
99 */
1010interface RefinedPlugin {
1111 configResolved : ( this : void , resolvedConfig : { mode : string } ) => void | Promise < void > ;
12- buildStart : ( this : PluginContext , options : { } ) => void | Promise < void > ;
13- resolveId : ( this : PluginContext , source : string ) => string | Promise < string > ;
12+ buildStart : ( this : any , options : { } ) => void | Promise < void > ;
13+ resolveId : ( this : any , source : string ) => string | Promise < string > ;
1414}
1515
1616function normalizeSlashes ( path : string | null ) : string | null {
@@ -27,14 +27,14 @@ describe("scalaJSPlugin", () => {
2727 timeout : 60000 , // running sbt takes time
2828 } ;
2929
30- const setup : ( options : ScalaJSPluginOptions ) => [ RefinedPlugin , PluginContext ] = ( options ) => {
30+ const setup : ( options : ScalaJSPluginOptions ) => [ RefinedPlugin , any ] = ( options ) => {
3131 const rawPlugin = scalaJSPlugin ( { cwd : cwd , ...options } ) as any ;
3232 const plugin = {
3333 configResolved : typeof rawPlugin . configResolved === 'function' ? rawPlugin . configResolved : rawPlugin . configResolved ?. handler ,
3434 buildStart : typeof rawPlugin . buildStart === 'function' ? rawPlugin . buildStart : rawPlugin . buildStart ?. handler ,
3535 resolveId : typeof rawPlugin . resolveId === 'function' ? rawPlugin . resolveId : rawPlugin . resolveId ?. handler ,
3636 } as RefinedPlugin ;
37- const fakePluginContext = { } as PluginContext ;
37+ const fakePluginContext = { } as any ;
3838 return [ plugin , fakePluginContext ] ;
3939 }
4040
0 commit comments