@@ -3,8 +3,7 @@ import path from 'node:path';
33import process from 'node:process' ;
44import { fileURLToPath } from 'node:url' ;
55import type { MockInstance } from 'vitest' ;
6- import type { Audit , PluginConfig , RunnerConfig } from '@code-pushup/models' ;
7- import { toUnixPath } from '@code-pushup/utils' ;
6+ import type { Audit } from '@code-pushup/models' ;
87import { eslintPlugin } from './eslint-plugin.js' ;
98
109describe ( 'eslintPlugin' , ( ) => {
@@ -15,27 +14,6 @@ describe('eslintPlugin', () => {
1514 let cwdSpy : MockInstance < [ ] , string > ;
1615 let platformSpy : MockInstance < [ ] , NodeJS . Platform > ;
1716
18- const replaceAbsolutePath = ( plugin : PluginConfig ) : PluginConfig => ( {
19- ...plugin ,
20- runner : {
21- ...( plugin . runner as RunnerConfig ) ,
22- args : ( plugin . runner as RunnerConfig ) . args ?. map ( arg =>
23- toUnixPath ( arg . replace ( path . dirname ( thisDir ) , '<dirname>' ) ) . replace (
24- / \/ e s l i n t \/ \d + \/ / ,
25- '/eslint/<timestamp>/' ,
26- ) ,
27- ) ,
28- ...( ( plugin . runner as RunnerConfig ) . configFile && {
29- configFile : toUnixPath (
30- ( plugin . runner as RunnerConfig ) . configFile ! ,
31- ) . replace ( / \/ e s l i n t \/ \d + \/ / , '/eslint/<timestamp>/' ) ,
32- } ) ,
33- outputFile : toUnixPath (
34- ( plugin . runner as RunnerConfig ) . outputFile ,
35- ) . replace ( / \/ e s l i n t \/ \d + \/ / , '/eslint/<timestamp>/' ) ,
36- } ,
37- } ) ;
38-
3917 beforeAll ( ( ) => {
4018 cwdSpy = vi . spyOn ( process , 'cwd' ) ;
4119 // Linux produces extra quotation marks for globs
@@ -55,7 +33,7 @@ describe('eslintPlugin', () => {
5533 patterns : [ 'src/**/*.js' , 'src/**/*.jsx' ] ,
5634 } ) ;
5735
58- expect ( replaceAbsolutePath ( plugin ) ) . toMatchSnapshot ( {
36+ expect ( plugin ) . toMatchSnapshot ( {
5937 version : expect . any ( String ) ,
6038 } ) ;
6139 } ) ;
0 commit comments