Skip to content

Commit 38c09e6

Browse files
committed
test(plugin-typescript): fix path for windows
1 parent a440788 commit 38c09e6

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed
Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
import { describe, expect } from 'vitest';
2+
import { osAgnosticPath } from '@code-pushup/test-utils';
23
import { getAudits } from '../utils.js';
34
import { createRunnerFunction } from './runner.js';
45

56
describe('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
});

0 commit comments

Comments
 (0)