File tree Expand file tree Collapse file tree 1 file changed +28
-7
lines changed
packages/plugin-typescript/src/lib/runner Expand file tree Collapse file tree 1 file changed +28
-7
lines changed Original file line number Diff line number Diff line change 11import { describe , expect } from 'vitest' ;
2+ import { osAgnosticPath } from '@code-pushup/test-utils' ;
23import { getAudits } from '../utils.js' ;
34import { createRunnerFunction } from './runner.js' ;
45
56describe ( 'createRunnerFunction' , ( ) => {
67 it ( 'should create valid audit outputs when called' , async ( ) => {
7- await expect (
8- createRunnerFunction ( {
9- tsconfig :
10- 'packages/plugin-typescript/mocks/fixtures/basic-setup/tsconfig.all-audits.json' ,
11- expectedAudits : getAudits ( ) ,
12- } ) ( ( ) => void 0 ) ,
13- ) . resolves . toMatchSnapshot ( ) ;
8+ const runnerFunction = createRunnerFunction ( {
9+ tsconfig :
10+ 'packages/plugin-typescript/mocks/fixtures/basic-setup/tsconfig.all-audits.json' ,
11+ expectedAudits : getAudits ( ) ,
12+ } ) ;
13+
14+ const result = await runnerFunction ( ) ;
15+
16+ const sanitizedResult = result . map ( audit => ( {
17+ ...audit ,
18+ ...( audit . details && {
19+ details : {
20+ ...audit . details ,
21+ issues : audit . details . issues ?. map ( issue => ( {
22+ ...issue ,
23+ ...( issue . source && {
24+ source : {
25+ ...issue . source ,
26+ file : osAgnosticPath ( issue . source . file ) ,
27+ } ,
28+ } ) ,
29+ } ) ) ,
30+ } ,
31+ } ) ,
32+ } ) ) ;
33+
34+ await expect ( sanitizedResult ) . toMatchSnapshot ( ) ;
1435 } , 35_000 ) ;
1536} ) ;
You can’t perform that action at this time.
0 commit comments