@@ -18,7 +18,12 @@ describe('executePlugin', () => {
1818 vi . restoreAllMocks ( ) ;
1919 } ) ;
2020
21- it ( 'should execute a valid plugin config' , async ( ) => {
21+ it ( 'should execute a valid plugin config and pass runner params' , async ( ) => {
22+ const executePluginRunnerSpy = vi . spyOn (
23+ runnerModule ,
24+ 'executePluginRunner' ,
25+ ) ;
26+
2227 await expect (
2328 executePlugin ( MINIMAL_PLUGIN_CONFIG_MOCK , {
2429 persist : { outputDir : '' } ,
@@ -39,6 +44,11 @@ describe('executePlugin', () => {
3944 } ) ,
4045 ] ) ,
4146 } ) ;
47+
48+ expect ( executePluginRunnerSpy ) . toHaveBeenCalledWith (
49+ MINIMAL_PLUGIN_CONFIG_MOCK ,
50+ { outputDir : '' } ,
51+ ) ;
4252 } ) ;
4353
4454 it ( 'should try to read cache if cache.read is true' , async ( ) => {
@@ -102,7 +112,7 @@ describe('executePlugin', () => {
102112
103113 await expect (
104114 executePlugin ( MINIMAL_PLUGIN_CONFIG_MOCK , {
105- persist : { outputDir : 'dummy-path-result-is-mocked' } ,
115+ persist : { outputDir : MEMFS_VOLUME } ,
106116 cache : { read : true , write : false } ,
107117 } ) ,
108118 ) . resolves . toStrictEqual ( {
@@ -122,6 +132,7 @@ describe('executePlugin', () => {
122132
123133 expect ( executePluginRunnerSpy ) . toHaveBeenCalledWith (
124134 MINIMAL_PLUGIN_CONFIG_MOCK ,
135+ { outputDir : MEMFS_VOLUME } ,
125136 ) ;
126137 } ) ;
127138
@@ -383,8 +394,8 @@ describe('executePlugins', () => {
383394 {
384395 ...MINIMAL_PLUGIN_CONFIG_MOCK ,
385396 runner : {
386- command : 'node ' ,
387- args : [ '-v ' ] ,
397+ command : 'echo ' ,
398+ args : [ '16 ' ] ,
388399 outputFile : 'output.json' ,
389400 outputTransform : ( outputs : unknown ) : Promise < AuditOutputs > =>
390401 Promise . resolve ( [
@@ -398,7 +409,7 @@ describe('executePlugins', () => {
398409 } ,
399410 } ,
400411 ] ,
401- persist : { outputDir : '.code-pushup' } ,
412+ persist : { outputDir : MEMFS_VOLUME } ,
402413 cache : { read : false , write : false } ,
403414 } ,
404415 { progress : false } ,
0 commit comments